1. Fill in the blank to create a centered heading.
________: center;
That's correct. Well done!
The correct code:
text-align
Press Tab or click button to advance to next exercise.
2. The style explicitly specifies the default alignment. Fill in the blank.
text-align: _____
That's correct. Well done!
The correct code:
left;
Press Tab or click button to advance to next exercise.
Press Tab or click button to advance to next exercise.
3. The style specifies the heading or paragraph is to be placed in the middle. Fill in the blank.
text-align: _____
That's correct. Well done!
The correct code:
center;
Press Tab or click button to advance to next exercise.
4. The styling smooths the left and right edges of the text block. Fill in the blank.
text-align: _____
That's correct. Well done!
The correct code:
justify;
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 tighten the spacing between characters and center the heading.
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.
Style all paragraphs with even left and right edges.
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.
Create a class of h3 headings named "normal" that explicitly gives them default alignment.
Press Tab or click button to advance to next exercise.
That's correct. Well done!
8. Create a class that isn't tied to an element that centers the text. Make up the name.
That's correct. Well done!
Example:
.mid {
text-align: center;
}
Press Tab or click button to advance to next exercise.
9. Style all headings of a particular size (your choice of size) so they line up on the right edge of the screen.
That's correct. Well done!
Example:
h6 {
text-align: right;
}
Press Tab or click button to advance to next exercise.
10. Create a class that isn't tied to an element that explicitly aligns text in the default position. Make up a name.
That's correct. Well done!
Example:
.normal {
text-align: left;
}
Press Tab or click button to advance to next exercise.
11. Style h4 headings so they're 85% of "normal" size and centered.
That's correct. Well done!
The correct code:
h4 {
font-size: .85em;
text-align: center;
}
Press Tab or click button to advance to next exercise.
12. Style all paragraphs with .1 em extra space between lines than the default with smooth left and right edges.
That's correct. Well done!
The correct code:
p {
line-height: 1.3em;
text-align: justify;
}
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. Create a class of h3 headings named "normal" that explicitly gives them default alignment.
Press Tab or click button to check answer.
The correct code:
h3.normal {
text-align: left;
}
Press Tab or click button to advance to next exercise.
Press Tab or click button to advance to next exercise.
14. Time goal: 30 seconds. Create a class that isn't tied to an element that centers the text. Make up the name.
Press Tab or click button to check answer.
Example:
.mid {
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: 30 seconds. Style all headings of a particular size (your choice of size) so they line up on the right edge of the screen.
Press Tab or click button to check answer.
Example:
h6 {
text-align: right;
}
Press Tab or click button to advance to next exercise.
Press Tab or click button to advance to next exercise.
16. Time goal: 35 seconds. Create a class that isn't tied to an element that explicitly aligns text in the default position. Make up a name.
Press Tab or click button to check answer.
Example:
.normal {
text-align: left;
}
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 h4 headings so they're 85% of "normal" size and centered.
Press Tab or click button to check answer.
The correct code:
h4 {
font-size: .85em;
text-align: center;
}
Press Tab or click button to advance to next exercise.
Press Tab or click button to advance to next exercise.
18. Time goal: 50 seconds. Style all paragraphs with .1 em extra space between lines than the default with smooth left and right edges
Press Tab or click button to check answer.
The correct code:
p {
line-height: 1.3em;
text-align: justify;
}
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