1. Code the line that colors each li element blue. Don't indent.
That's correct. Well done!
The correct code:
background-color: blue;
Press Tab or click button to advance to next exercise.
2. Instead of coding the whole div blue, we're coding each item blue. The div ID is "navbar". Code the first line for specifying blue for individual items.
That's correct. Well done!
The correct code:
div#navbar ul li {
Press Tab or click button to advance to next exercise.
Press Tab or click button to advance to next exercise.
3. We've eliminated the background-color of the div, but we still want it to shrink to the width of its contents. What is the line of CSS that does that? Don't indent.
That's correct. Well done!
The correct code:
display: inline-block;
Press Tab or click button to advance to next exercise.
4. To style the anchors inside a div with the ID "nav", code the first line.
That's correct. Well done!
The correct code:
div#nav ul li a {
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 the first two lines that color individual items orange.
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 that colors list items when they're inside the div with an ID of "navigation".
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 line that colors individual list items hex cccccc. Don't indent.
Press Tab or click button to advance to next exercise.
That's correct. Well done!
8. In three lines of code color the individual list items in a div. Make up the ID. Use any color name a child would know.
That's correct. Well done!
Example:
div#nav ul li {
background-color: black;
}
Press Tab or click button to advance to next exercise.
9. Code the first line of CSS that styles anchors in a navbar. Make up the ID.
That's correct. Well done!
Example:
div#menu ul li a {
Press Tab or click button to advance to next exercise.
10. Fill in the blank to create an anchor that you can pad out.
_______: block;
That's correct. Well done!
The correct code:
display
Press Tab or click button to advance to next exercise.
11. Fill in the blank to create an anchor that we can pad out.
display: _____;
That's correct. Well done!
The correct code:
block
Press Tab or click button to advance to next exercise.
12. Code four lines of CSS that specify block display for anchors and give them equal padding on all four sides. Make up the ID and amount of padding.
That's correct. Well done!
Example:
div#nav ul li a {
display: block;
padding: .75em;
}
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: 30 seconds. Code the line that colors individual list items hex cccccc. Don't indent.
Press Tab or click button to check answer.
The correct code:
background-color: #cccccc;
Press Tab or click button to advance to next exercise.
Press Tab or click button to advance to next exercise.
14. Time goal: 45 seconds. In three lines of code color the individual list items in a div. Make up the ID. Use any color name a child would know.
Press Tab or click button to check answer.
Example:
div#nav ul li {
background-color: black;
}
Press Tab or click button to advance to next exercise.
Press Tab or click button to advance to next exercise.
15. Time goal: 20 seconds. Code the first line of CSS that styles anchors in a navbar. Make up the ID.
Press Tab or click button to check answer.
Example:
div#menu ul li a {
Press Tab or click button to advance to next exercise.
Press Tab or click button to advance to next exercise.
16. Time goal: 15 seconds. Fill in the blank to create an anchor that you can pad out.
_______: block;
Press Tab or click button to check answer.
The correct code:
display
Press Tab or click button to advance to next exercise.
Press Tab or click button to advance to next exercise.
17. Time goal: 10 seconds. Fill in the blank to create an anchor that we can pad out.
display: _____;
Press Tab or click button to check answer.
The correct code:
block
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. Code four lines of CSS that specify block display for anchors and give them equal padding on all four sides. Make up the ID and amount of padding.
Press Tab or click button to check answer.
Example:
div#nav ul li a {
display: block;
padding: .75em;
}
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