1. To style an image so text wraps around it, you use the word _____.
That's correct. Well done!
The correct answer:
float
Press Tab or click button to advance to next exercise.
2. To prevent a paragraph from wrapping around an image, you use the word _____.
That's correct. Well done!
The correct answer:
clear
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 want text jammed up against a floated image, you need to specify a _____.
That's correct. Well done!
The correct answer:
margin
Press Tab or click button to advance to next exercise.
4. To wrap text around the left side of an image, fill in the blank.
img.text-on-left {
________
}
That's correct. Well done!
The correct code:
float: right;
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 code an image id that wraps text on the right.
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 styling specifying that all images are to float left.
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 a class of paragraphs named "wrapless" that won't wrap.
Press Tab or click button to advance to next exercise.
That's correct. Well done!
8. Create an image id for an image that floats left. Make up the id name.
That's correct. Well done!
The correct code:
img#floater {
float: left;
}
Press Tab or click button to advance to next exercise.
9. Create a paragraph class that won't wrap. Make up the class name.
That's correct. Well done!
The correct code:
p.cleared {
clear: both;
}
Press Tab or click button to advance to next exercise.
10. Using the following CSS code an image that lets text wrap on its left. Make up the image path including the image type. Don't bother with alt text or dimensions.
img.fl {
float: left;
}
img.fr {
float: right;
}
That's correct. Well done!
The correct code:
<img class="fr" src="pic6.png">
Press Tab or click button to advance to next exercise.
11. Using the following CSS code an image that lets text wrap on its right. Make up the image path including the image type. Don't bother with alt text or dimensions. Next, code a paragraph that wraps. Follow that with a paragraph that doesn't wrap. Include a little text in the paragraphs.
img.fl {
float: left;
}
img.fr {
float: right;
}
p.indy {
clear: both;
}
That's correct. Well done!
The correct code:
<img class="fl" src="doctor.jpg">
<p>On the left, Dr. Strangelove.</p>
<p class="indy">But enough about me.</p>
Press Tab or click button to advance to next exercise.
12. Create an image class that floats it left and adds 2 ems of white space between the image and the text. Make up the class name. Use either way to specify the space.
That's correct. Well done!
Example:
img.special {
float: left;
margin-right: 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: 30 seconds. Style a class of paragraphs named "wrapless" that won't wrap.
Press Tab or click button to check answer.
The correct code:
p.wrapless {
clear: both;
}
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 an image id for an image that floats left. Make up the id name.
Press Tab or click button to check answer.
The correct code:
img#floater {
float: left;
}
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. Create a paragraph class that won't wrap. Make up the class name.
Press Tab or click button to check answer.
The correct code:
p.cleared {
clear: both;
}
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. Using the following CSS code an image that lets text wrap on its left. Make up the image path including the image type. Don't bother with alt text or dimensions.
img.fl {
float: left;
}
img.fr {
float: right;
}
Press Tab or click button to check answer.
The correct code:
<img class="fr" src="pic6.png">
Press Tab or click button to advance to next exercise.
Press Tab or click button to advance to next exercise.
17. Time goal: 115 seconds. Using the following CSS code an image that lets text wrap on its right. Make up the image path including the image type. Don't bother with alt text or dimensions. Next, code a paragraph that wraps. Follow that with a paragraph that doesn't wrap. Include a little text in the paragraphs.
img.fl {
float: left;
}
img.fr {
float: right;
}
p.indy {
clear: both;
}
Press Tab or click button to check answer.
The correct code:
<img class="fl" src="doctor.jpg">
<p>On the left, Dr. Strangelove.</p>
<p class="indy">But enough about me.</p>
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. Create an image class that floats it left and adds 2 ems of white space between the image and the text. Make up the class name. Use either way to specify the space.
Press Tab or click button to check answer.
Example:
img.special {
float: left;
margin-right: 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