1. What is the name for p.special or #intro? (One word)
That's correct. Well done!
The correct answer:
selector
Press Tab or click button to advance to next exercise.
2. What is the selector in this code?
div.extra {
margin-left: 1em;
}
That's correct. Well done!
The correct answer:
div.extra
Press Tab or click button to advance to next exercise.
Press Tab or click button to advance to next exercise.
3. Fill in the blank that selects all paragraphs in the div with an ID of "important."
div#important ___ {
That's correct. Well done!
The correct code:
p
Press Tab or click button to advance to next exercise.
4. Fill in the blank that selects all the images in a list with the ID "pixList"
________ li img {
That's correct. Well done!
The correct code:
ul#pixList
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 to select all h3 headings in divs of the class "content".
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 selects the first paragraph after any div of the class "important".
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 that selects the first level of divs within the div with an ID of "content".
Press Tab or click button to advance to next exercise.
That's correct. Well done!
8. Code the first line that selects all h2 headings of the class "normal" and all paragraphs.
That's correct. Well done!
The correct code:
h2.normal, p {
Press Tab or click button to advance to next exercise.
9. Code the first line that selects the first level of list items in all unordered lists.
That's correct. Well done!
The correct code:
ul > li {
Press Tab or click button to advance to next exercise.
10. Code the first line that selects all images in the div with a particular ID. Make up the ID name.
That's correct. Well done!
Example:
div#gallery img {
Press Tab or click button to advance to next exercise.
11. Code the first line that selects all paragraphs of the class "info" in the div with an ID of "main".
That's correct. Well done!
The correct code:
div#main p.info {
Press Tab or click button to advance to next exercise.
12. Style the first paragraph inside all divs of a certain class. Style the paragraph text 120% of normal size. Make up the class name.
That's correct. Well done!
Example:
div.content + p {
font-size: 1.2em;
}
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: 20 seconds. Code the first line that selects the first level of divs within the div with an ID of "content".
Press Tab or click button to check answer.
The correct code:
div#content > div {
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. Code the first line that selects all h2 headings of the class "normal" and all paragraphs.
Press Tab or click button to check answer.
The correct code:
h2.normal, p {
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. Code the first line that selects the first level of list items in all unordered lists.
Press Tab or click button to check answer.
The correct code:
ul > li {
Press Tab or click button to advance to next exercise.
Press Tab or click button to advance to next exercise.
16. Time goal: 20 seconds. Code the first line that selects the first level of list items in all unordered lists.
Press Tab or click button to check answer.
Correct answer:
ul > li {
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 first line that selects all paragraphs of the class "info" in the div with an ID of "main".
Press Tab or click button to check answer.
The correct code:
div#main p.info {
Press Tab or click button to advance to next exercise.
Press Tab or click button to advance to next exercise.
18. Time goal: 40 seconds. Style the first paragraph inside all divs of a certain class. Style the paragraph text 120% of normal size. Make up the class name.
Press Tab or click button to check answer.
Example:
div.content + p {
font-size: 1.2em;
}
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