fa
1. What is like a class, but is used only once in an HTML document? Answer with one word.
That's correct. Well done!
The correct answer:
id
Press Tab or click button to advance to next exercise.
2. Instead of the dot that's used to create a class, what do you use to create an id?
That's correct. Well done!
The correct answer:
#
Press Tab or click button to advance to next exercise.
Press Tab or click button to advance to next exercise.
3. In the following tag, fill in the blank to assign the paragraph the id named "special"
<p ______>
That's correct. Well done!
The correct code:
id="special"
Press Tab or click button to advance to next exercise.
4. Rewrite the following code so it's an id rather than a class.
blockquote.standout {
font-weight: bolder;
}
That's correct. Well done!
The correct code:
blockquote#standout {
font-weight: bolder;
}
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 an id named "prominent" that isn't tied to an element.
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 of an h3 specification named "fancy" that can be used only once on the page.
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 an h5 id named "tight" that reduces the space between words by .2 ems.
Press Tab or click button to advance to next exercise.
That's correct. Well done!
8. Create an h2 id named "oblique" that italicizes the text.
That's correct. Well done!
The correct code:
h2#oblique {
font-style: italic;
}
Press Tab or click button to advance to next exercise.
9. Create an id not tied to an element that assigns the font stack courier, monospace. The id name is "special"
That's correct. Well done!
The correct code:
#special {
font-family: courier, monospace;
}
Press Tab or click button to advance to next exercise.
10. Style paragraphs at 120% of the "normal" size. Then create a paragraph id that sizes text 3/4 of "normal." Make up the id name.
That's correct. Well done!
Example:
p {
font-size: 1.2em;
}
p#small {
font-size: .75em;
}
Press Tab or click button to advance to next exercise.
11. Code a heading (your choice of size), assigning it an id (your choice of name). Include opening and closing tags and some text.
That's correct. Well done!
Example:
<h3 id="slight">A Minor Point</h3>
Press Tab or click button to advance to next exercise.
12. Group two ids for headings of different sizes (your choice of size), specifying centered text. Make up the id names.
That's correct. Well done!
Example:
h2#special_1, h4#special_2 {
text-align: center;
}
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 an h5 id named "tight" that reduces the space between words by .2 ems.
Press Tab or click button to check answer.
The correct code:
h5#tight {
word-spacing: -.2em;
}
Press Tab or click button to advance to next exercise.
Press Tab or click button to advance to next exercise.
14. Time goal: 40 seconds. Create an h2 id named "oblique" that italicizes the text.
Press Tab or click button to check answer.
The correct code:
h2#oblique {
font-style: italic;
}
Press Tab or click button to advance to next exercise.
Press Tab or click button to advance to next exercise.
15. Time goal: 50 seconds. Create an id not tied to an element that assigns the font stack courier, monospace. The id name is "special"
Press Tab or click button to check answer.
The correct code:
#special {
font-family: courier, monospace;
}
Press Tab or click button to advance to next exercise.
Press Tab or click button to advance to next exercise.
16. Time goal: 60 seconds. Style paragraphs at 120% of the "normal" size. Then create a paragraph id that sizes text 3/4 of "normal." Make up the id name.
Press Tab or click button to check answer.
Example:
p {
font-size: 1.2em;
}
p#small {
font-size: .75em;
}
Press Tab or click button to advance to next exercise.
Press Tab or click button to advance to next exercise.
17. Time goal: 35 seconds. Code a heading (your choice of size), assigning it an id (your choice of name). Include opening and closing tags and some text.
Press Tab or click button to check answer.
Example:
<h3 id="slight">A Minor Point</h3>
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. Group two ids for headings of different sizes (your choice of size), specifying centered text. Make up the id names.
Press Tab or click button to check answer.
Example:
h2#special_1, h4#special_2 {
text-align: center;
}
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