1. What is it called when you style two or more elements at the same time?
That's correct. Well done!
The correct answer:
grouping
Press Tab or click button to advance to next exercise.
2. To add h3 headings to the group, fill in the blank.
h2___ {
That's correct. Well done!
The correct code:
, h3
Press Tab or click button to advance to next exercise.
Press Tab or click button to advance to next exercise.
3. If the font-size for the body has been styled 1.2 em, what percentage of the browser default is the paragraph size, based on the following code? Answer with a numeral followed by the percent sign.
h1, p {
font-family: Arial, Helvetica, sans-serif;
font-size: 1em;
}
That's correct. Well done!
The correct code:
120%
Press Tab or click button to advance to next exercise.
4. Fill in the blank to add h3 headings and paragraphs to the style.
h2____ {
That's correct. Well done!
The correct code:
, h3, p
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 assign the three biggest headings the font stack Arial, Helvetica, sans-serif.
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.
Assign the largest heading and paragraphs the hex code efefef.
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.
Style the two smallest heading sizes 125% larger than "normal."
Press Tab or click button to advance to next exercise.
That's correct. Well done!
8. Specify centering for two sizes (your choice of sizes) of headings.
That's correct. Well done!
Example:
h2, h4 {
text-align: center;
}
Press Tab or click button to advance to next exercise.
9. Specify a text color for a heading (your choice of size) and paragraphs. Use a color name not a hex number.
That's correct. Well done!
Example:
h1, p {
color: gray;
}
Press Tab or click button to advance to next exercise.
10. Style a class of paragraphs and a class not tied to an element with the boldest (use a numeral) text. Make up the class name.
That's correct. Well done!
Example:
p.standout, .extra {
font-weight: 900;
}
Press Tab or click button to advance to next exercise.
11. Style paragraphs and a class of h3 headings black. Style paragraphs with a first-line indent (your choice of how much indent). Use a word to specify the color. Make up the name of the class.
That's correct. Well done!
Example:
p, h3.normal {
color: black;
}
p {
text-indent: 1.5em;
}
Press Tab or click button to advance to next exercise.
12. Style three heading sizes (your choice of sizes), specifying default letter-spacing and roughly an extra half-line of spacing between lines.
That's correct. Well done!
Example:
h2, h3, h5 {
letter-spacing: 0;
line-height: 1.8em;
}
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. Style the two smallest heading sizes 125% larger than "normal."
Press Tab or click button to check answer.
The correct code:
h5, h6 {
font-size: 1.25em;
}
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. Specify centering for two sizes (your choice of sizes) of headings.
Press Tab or click button to check answer.
Example:
h2, h4 {
text-align: center;
}
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. Specify a text color for a heading (your choice of size) and paragraphs. Use a color name not a hex number.
Press Tab or click button to check answer.
Example:
h1, p {
color: gray;
}
Press Tab or click button to advance to next exercise.
Press Tab or click button to advance to next exercise.
16. Time goal: 45 seconds. Style a class of paragraphs and a class not tied to an element with the boldest (use a numeral) text. Make up the class name.
Press Tab or click button to check answer.
Example:
p.standout, .extra {
font-weight: 900;
}
Press Tab or click button to advance to next exercise.
Press Tab or click button to advance to next exercise.
17. Time goal: 60 seconds. Style paragraphs and a class of h3 headings black. Style paragraphs with a first-line indent (your choice of how much indent). Use a word to specify the color. Make up the name of the class.
Press Tab or click button to check answer.
Example:
p, h3.normal {
color: black;
}
p {
text-indent: 1.5em;
}
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. Style three heading sizes (your choice of sizes), specifying default letter-spacing and roughly an extra half-line of spacing between lines.
Press Tab or click button to check answer.
Example:
h2, h3, h5 {
letter-spacing: 0;
line-height: 1.8em;
}
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