1. To create a header, main section, or sidebar, you code a ___.
That's correct. Well done!
The correct answer:
div
Press Tab or click button to advance to next exercise.
2. To style a one-of-a-kind div like a header, main section, or footer, type the next character.
div
That's correct. Well done!
The correct code:
#
You code an ID
Press Tab or click button to advance to next exercise.
Press Tab or click button to advance to next exercise.
3. Two divs will share the same styling. Type the next character.
div
That's correct. Well done!
The correct code:
.
You code a class.
Press Tab or click button to advance to next exercise.
4. If body text is styled black, div text is styled grey, and paragraph text is styled blue, what color is the text of headings inside the div?
That's correct. Well done!
The correct answer:
grey
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 style the main div.
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 opening HTML tag for a div whose ID is sidebar.
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 styling for a div "header" and a div "footer".
Press Tab or click button to advance to next exercise.
That's correct. Well done!
8. Code the first line of styling that can be used for more than one div. Make up what you need to.
That's correct. Well done!
Example:
div.product_details {
Press Tab or click button to advance to next exercise.
9. Code the HTML opening tags for a div belonging to a class that's inside a div with an ID. Code opening tags for both divs. Make up the class name and ID.
That's correct. Well done!
Example:
<div id="main">
<div class="section">
Press Tab or click button to advance to next exercise.
10. Code the styling for a class of heading that overrides the font color, black, of the div it's in. Choose the heading size, class name, and color. The color can be any name known to children that's not the div color.
That's correct. Well done!
Example:
h3.special {
color: grey;
}
Press Tab or click button to advance to next exercise.
11. Style a div, to be used only once, with an equal margin all around and the same padding all around.
That's correct. Well done!
Example:
div#details {
margin: .5em;
padding: .5em;
}
Press Tab or click button to advance to next exercise.
12. Code the opening and closing HTML tags for a div with an ID. Within that div code the opening and closing tags for a div with an ID. Make up the ID names.
That's correct. Well done!
Example:
<div id="main">
<div id="section">
</div>
</div>
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 the first line of styling for a div "header" and a div "footer".
Press Tab or click button to check answer.
The correct code:
div#header, div#footer {
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. Code the first line of styling that can be used for more than one div. Make up what you need to.
Press Tab or click button to check answer.
Example:
div.product_details {
Press Tab or click button to advance to next exercise.
Press Tab or click button to advance to next exercise.
15. Time goal: 40 seconds. Code the HTML opening tags for a div belonging to a class that's inside a div with an ID. Code opening tags for both divs. Make up the class name and ID.
Press Tab or click button to check answer.
Example:
<div id="main">
<div class="section">
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. Code the styling for a class of heading that overrides the font color, black, of the div it's in. Choose the heading size, class name, and color. The color can be any name known to children that's not the div color.
Press Tab or click button to check answer.
Example:
h3.special {
color: grey;
}
Press Tab or click button to advance to next exercise.
Press Tab or click button to advance to next exercise.
17. Time goal: 50 seconds. Style a div, to be used only once, with an equal margin all around and the same padding all around.
Press Tab or click button to check answer.
Example:
div#details {
margin: .5em;
padding: .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. Code the opening and closing HTML tags for a div with an ID. Within that div code the opening and closing tags for a div with an ID. Make up the ID names.
Press Tab or click button to check answer.
Example:
<div id="main">
<div id="section">
</div>
</div>
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