1. Fill in the recommended unit of measurement.
font-size: 5__.
That's correct. Well done!
The correct code:
em
Press Tab or click button to advance to next exercise.
2. Fill in the best unit of measurement for a div.
width: 50___.
That's correct. Well done!
The correct code:
%
Press Tab or click button to advance to next exercise.
Press Tab or click button to advance to next exercise.
3. Code one line to specify a solid black hairline border. Don't indent.
That's correct. Well done!
The correct code:
border: 1px solid black;
Press Tab or click button to advance to next exercise.
4. Code the next line, specifying a width (your choice) for the table class. Indent it.
table.standard {
That's correct. Well done!
Example:
width: 45%;
Press Tab or click button to advance to next exercise.
5. Drag-and-drop: Holding down the left mouse button, drag the pieces of code onto the screen to code an iframe tag. Note: On this one you won't use all the pieces.
6. Click in the box and type the next character. I'll autocomplete. Don't type spaces or carriage returns. When the exercise is complete, I'll turn the exercise number green.
Code a line that specifies overall margins of 2 units, using the preferred unit of measurement (ems, percentage, or pixels).
That's correct. Well done!
Press Tab or click button to advance to next exercise.
7. Fail-safe coding. If you type the wrong character, I'll cancel the keystroke. Type spaces. When the exercise is complete, I'll turn the exercise number green.
Code a line that specifies padding for all four sides: no padding for top and bottom, 3 units of padding for left and right. Use the preferred unit of measurement for padding. Don't indent.
Press Tab or click button to advance to next exercise.
That's correct. Well done!
8. Write a line of code to specify a solid black hairline border. Don't indent.
That's correct. Well done!
The correct code:
border: 1px solid black;
Press Tab or click button to advance to next exercise.
9. Style a class of paragraph that specifies 2 units for the font size. Use the preferred unit of measurement. Make up the class name.
That's correct. Well done!
Example:
p.big {
font-size: 2em;
}
Press Tab or click button to advance to next exercise.
10. Style a div with an id, specifying a width of your choice. Make up the id.
That's correct. Well done!
Example:
div#main {
width: 65%;
}
Press Tab or click button to advance to next exercise.
11. Style a class of heading (your choice of size) with a bottom margin. Don't specify the other margins. Choose how much margin. Make up the class name.
That's correct. Well done!
Example:
h2.special {
margin-bottom: 1.5em;
}
Press Tab or click button to advance to next exercise.
12. Fix a div with an id of "header" at the top-left of the window.
That's correct. Well done!
The correct code:
div#header {
position: fixed;
top: 0;
left: 0;
}
Press Tab or click button to advance to next exercise.
The next several exercises are timed. If you type slowly or dislike time pressure, feel free to increase the allotted time.
13. Time goal: 25 seconds. Code a line that specifies padding for all four sides: no padding for top and bottom, 3 units of padding for left and right. Use the preferred unit of measurement for padding. Don't indent.
Press Tab or click button to check answer.
The correct code:
padding: 0 3em 0 3em;
Press Tab or click button to advance to next exercise.
Press Tab or click button to advance to next exercise.
14. Time goal: 25 seconds. Write a line of code to specify a solid black hairline border. Don't indent.
Press Tab or click button to check answer.
The correct code:
border: 1px solid black;
Press Tab or click button to advance to next exercise.
Press Tab or click button to advance to next exercise.
15. Time goal: 30 seconds. Style a class of paragraph that specifies 2 units for the font size. Use the preferred unit of measurement. Make up the class name.
Press Tab or click button to check answer.
Example:
p.big {
font-size: 2em;
}
Press Tab or click button to advance to next exercise.
Press Tab or click button to advance to next exercise.
16. Time goal: 30 seconds. Style a div with an id, specifying a width of your choice. Make up the id.
Press Tab or click button to check answer.
Example:
div#main {
width: 65%;
}
Press Tab or click button to advance to next exercise.
Press Tab or click button to advance to next exercise.
17. Time goal: 40 seconds. Style a class of heading (your choice of size) with a bottom margin. Don't specify the other margins. Choose how much margin. Make up the class name.
Press Tab or click button to check answer.
Example:
h2.special {
margin-bottom: 1.5em;
}
Press Tab or click button to advance to next exercise.
Press Tab or click button to advance to next exercise.
18. Time goal: 55 seconds. Fix a div with an id of "header" at the top-left of the window.
Press Tab or click button to check answer.
The correct code:
div#header {
position: fixed;
top: 0;
left: 0;
}
Press Tab or click button to advance to next exercise.
Press Tab or click button to advance to next exercise.
19. Access this live coding exercise at JS Fiddle. When you've completed the exercise, close the JS Fiddle window, and you'll be returned to this page. (If JS Fiddle displays a warning message saying that your changes will be reset, click Leave this Page.)
Click button to advance.
20. Access this live coding exercise at JS Fiddle. When you've completed the exercise, close the JS Fiddle window, and you'll be returned to this page. (If JS Fiddle displays a warning message saying that your changes will be reset, click Leave this Page.)
Click button to advance.
Post a review on Amazon for the paperback or the Kindle edition.
Email me to give me a compliment, complaint, or correction. I'll respond.
0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19
1
0