1. When you specify a font-family for the ____, all the text on the page will be in that font unless you override it. Fill in the blank with a 4-letter word.
That's correct. Well done!
The correct answer:
body
Press Tab or click button to advance to next exercise.
2. In the following code, the paragraph is a _____ of the body.
<body>
<p>That's about it.</p>
</body>
That's correct. Well done!
The correct answer:
child
Press Tab or click button to advance to next exercise.
Press Tab or click button to advance to next exercise.
3. If you don't specify a font-size for the body or any other element, how many ems will all the text on the page be sized at? Answer with a numeral.
That's correct. Well done!
The correct answer:
1
Press Tab or click button to advance to next exercise.
4. When you specify an element's size in ems, the resulting size will be that number multiplied by the size of the element's ______.
That's correct. Well done!
The correct answer:
parent
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 specify a font-size of 120% of the browser default for all elements on the page, except when overridden by additional styling.
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.
A font-size of 2 ems has been specified for the body. Style paragraphs at the browser default size.
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.
A span within a paragraph is a child of that paragraph. If paragraphs are styled with a font-size of 1.5 ems, create a class not tied to an element, named "big", that will double the font-size of text within the span.
Press Tab or click button to advance to next exercise.
That's correct. Well done!
8. The body has been styled Arial, sans-serif. Override that for h1 headings, with a two-font stack whose first font is Times.
That's correct. Well done!
The correct code:
h1 {
font-family: Times, serif;
}
Press Tab or click button to advance to next exercise.
9. Create a class not tied to an element that allows you to italicize a span within a heading or paragraph. Make up a class name.
That's correct. Well done!
Example:
.special {
font-style: italic;
}
Press Tab or click button to advance to next exercise.
10. Code a style for the entire page that makes black the "normal" color for all headings and paragraphs. Use the color name, not a hex number.
That's correct. Well done!
The correct code:
body {
color: black;
}
Press Tab or click button to advance to next exercise.
11. If paragraphs are styled with .75 em font-size, resulting in three-quarters of the browser's default, code the styling for the body.
That's correct. Well done!
The correct code:
body {
font-size: 1em;
}
Press Tab or click button to advance to next exercise.
12. The body has been styled so the "normal" color for headings and paragraphs is black. Style a heading (your choice of size) that specifies a different color than "normal." Use a color name, not a hex number.
That's correct. Well done!
Example:
h3 {
color: blue;
}
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. A span within a paragraph is a child of that paragraph. If paragraphs are styled with a font-size of 1.5 ems, create a class not tied to an element, named "big", that will double the font-size of text within the span.
Press Tab or click button to check answer.
The correct code:
.big {
font-size: 2em;
}
Press Tab or click button to advance to next exercise.
Press Tab or click button to advance to next exercise.
14. Time goal: 35 seconds. The body has been styled Arial, sans-serif. Override that for h1 headings, with a two-font stack whose first font is Times.
Press Tab or click button to check answer.
The correct code:
h1 {
font-family: Times, serif;
}
Press Tab or click button to advance to next exercise.
Press Tab or click button to advance to next exercise.
15. Time goal: 35 seconds. Create a class not tied to an element that allows you to italicize a span within a heading or paragraph. Make up a class name.
Press Tab or click button to check answer.
Example:
.special {
font-style: italic;
}
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 a style for the entire page that makes black the "normal" color for all headings and paragraphs. Use the color name, not a hex number.
Press Tab or click button to check answer.
The correct code:
body {
color: black;
}
Press Tab or click button to advance to next exercise.
Press Tab or click button to advance to next exercise.
17. Time goal: 30 seconds. If paragraphs are styled with .75 em font-size, resulting in three-quarters of the browser's default, code the styling for the body.
Press Tab or click button to check answer.
The correct code:
body {
font-size: 1em;
}
Press Tab or click button to advance to next exercise.
Press Tab or click button to advance to next exercise.
18. Time goal: 25 seconds. The body has been styled so the "normal" color for headings and paragraphs is black. Style a heading (your choice of size) that specifies a different color than "normal." Use a color name, not a hex number.
Press Tab or click button to check answer.
Example:
h3 {
color: blue;
}
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