1. Code a single line that adds an em of padding to the left and right of an element. Don't indent.
That's correct. Well done!
The correct code:
padding: 0 1em 0 1em;
Press Tab or click button to advance to next exercise.
2. In the book I choose to expand the div horizontally by adding padding to the li element. An alternative is to add padding to the __ element.
That's correct. Well done!
The correct answer:
ul
Press Tab or click button to advance to next exercise.
Press Tab or click button to advance to next exercise.
3. Code a single line that adds 1.5 ems of padding to only the top and bottom of an element. Don't indent.
That's correct. Well done!
The correct code:
padding: 1.5em 0 1.5em 0;
Press Tab or click button to advance to next exercise.
4. Code the first line that styles a navbar at the ul level. Make up the ID.
That's correct. Well done!
Example:
div#navbar ul {
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 add a half em of whitespace all around.
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 the first line of CSS to style a navbar at the li level. The ID is menu.
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 the first line of CSS to style a navbar at the link level. The ID is nav.
Press Tab or click button to advance to next exercise.
That's correct. Well done!
8. Code the first line of CSS to style a navbar at the div level. Make up what you need to.
That's correct. Well done!
Example:
div#navigation {
Press Tab or click button to advance to next exercise.
9. In a single line of code add 1 em of padding to the left and right sides of an element. Don't indent.
That's correct. Well done!
The correct code:
padding: 0 1em 0 1em;
Press Tab or click button to advance to next exercise.
10. Code the first two lines of CSS to add 1 em of padding to all four sides of a ul. Use the most concise form of code. Make up the ID.
That's correct. Well done!
Example:
div#menu ul {
padding: 1em;
Press Tab or click button to advance to next exercise.
11. In three lines of code add the same amount of whitespace at left and right to list items. Make up the ID and the amount of whitespace.
That's correct. Well done!
Example:
div#nav ul li {
padding: 0 .5em 0 .5em;
}
Press Tab or click button to advance to next exercise.
12. In three lines of code add the same amount of whitespace at top and bottom to an unordered list. Make up the ID and the amount of whitespace.
That's correct. Well done!
Example:
div#nav ul {
padding: .5em 0 .5em 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: 20 seconds. Code the first line of CSS to style a navbar at the link level. The ID is nav.
Press Tab or click button to check answer.
The correct code:
div#nav ul li a {
Press Tab or click button to advance to next exercise.
Press Tab or click button to advance to next exercise.
14. Time goal: 20 seconds. Code the first line of CSS to style a navbar at the div level. Make up what you need to.
Press Tab or click button to check answer.
Example:
div#navigation {
Press Tab or click button to advance to next exercise.
Press Tab or click button to advance to next exercise.
15. Time goal: 25 seconds. In a single line of code add 1 em of padding to the left and right sides of an element. Don't indent.
Press Tab or click button to check answer.
The correct code:
padding: 0 1em 0 1em;
Press Tab or click button to advance to next exercise.
Press Tab or click button to advance to next exercise.
16. Time goal: 35 seconds. Code the first two lines of CSS to add 1 em of padding to all four sides of a ul. Use the most concise form of code. Make up the ID.
Press Tab or click button to check answer.
Example:
div#menu ul {
padding: 1em;
Press Tab or click button to advance to next exercise.
Press Tab or click button to advance to next exercise.
17. Time goal: 45 seconds. In three lines of code add the same amount of whitespace at left and right to list items. Make up the ID and the amount of whitespace.
Press Tab or click button to check answer.
Example:
div#nav ul li {
padding: 0 .5em 0 .5em;
}
Press Tab or click button to advance to next exercise.
Press Tab or click button to advance to next exercise.
18. Time goal: 40 seconds. In three lines of code add the same amount of whitespace at top and bottom to an unordered list. Make up the ID and the amount of whitespace.
Press Tab or click button to check answer.
Example:
div#nav ul {
padding: .5em 0 .5em 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