1. Code a line that colors a div solid 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. Code a line that specifies white for a heading to make it stand out in a blue div.
That's correct. Well done!
The correct code:
color: white;
Press Tab or click button to advance to next exercise.
Press Tab or click button to advance to next exercise.
3. In 3 lines of code style a div so it's colored hex 888888. Make up the ID.
That's correct. Well done!
The correct code:
div#nav {
background-color: #888888;
}
Press Tab or click button to advance to next exercise.
4. In 3 lines of code style navbar anchors so they're hex 000000. Make up the ID.
That's correct. Well done!
The correct code:
div#navigation ul li a {
color: #000000;
}
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 color a div black.
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 styles navbar anchors inside a div with an ID of "navbar".
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 increases the size of navbar anchors to 120%, followed by a line that styles them next-to-boldest. Use a number for the bold. Don't indent.
Press Tab or click button to advance to next exercise.
That's correct. Well done!
8. Fill in the blank to force a div to limit its width to the width of its contents.
_______: inline-block;
That's correct. Well done!
The correct code:
display
Press Tab or click button to advance to next exercise.
9. Fill in the blank to force a div to limit its width to the width of its contents.
display: ______block;
That's correct. Well done!
The correct code:
inline-
Press Tab or click button to advance to next exercise.
10. Code the line that forces a div to limit its width to the width of its contents. Don't indent.
That's correct. Well done!
The correct code:
display: inline-block;
Press Tab or click button to advance to next exercise.
11. Code the line that prevents the browser from adding whitespace on the left side of a list. Don't indent.
That's correct. Well done!
The correct code:
padding-left: 0;
Press Tab or click button to advance to next exercise.
12. Code 4 lines of CSS that eliminate bullets and whitespace to the left. Make up the div ID.
That's correct. Well done!
Example:
div#menu ul {
list-style-type: none;
padding-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: 35 seconds. Code a line that increases the size of navbar anchors to 120%, followed by a line that styles them next-to-boldest. Use a number for the bold. Don't indent.
Press Tab or click button to check answer.
The correct code:
font-size: 1.2em;
font-weight: 800;
Press Tab or click button to advance to next exercise.
Press Tab or click button to advance to next exercise.
14. Time goal: 15 seconds. Fill in the blank to force a div to limit its width to the width of its contents.
_______: inline-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.
15. Time goal: 15 seconds. Fill in the blank to force a div to limit its width to the width of its contents.
display: ______block;
Press Tab or click button to check answer.
The correct code:
inline-
Press Tab or click button to advance to next exercise.
Press Tab or click button to advance to next exercise.
16. Time goal: 25 seconds. Code the line that forces a div to limit its width to the width of its contents. Don't indent.
Press Tab or click button to check answer.
The correct code:
display: inline-block;
Press Tab or click button to advance to next exercise.
Press Tab or click button to advance to next exercise.
17. Time goal: 20 seconds. Code the line that prevents the browser from adding whitespace on the left side of a list. Don't indent.
Press Tab or click button to check answer.
The correct code:
padding-left: 0;
Press Tab or click button to advance to next exercise.
Press Tab or click button to advance to next exercise.
18. Time goal: 60 seconds. Code 4 lines of CSS that eliminate bullets and whitespace to the left. Make up the div ID.
Press Tab or click button to check answer.
Example:
div#menu ul {
list-style-type: none;
padding-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