1. Let's review the image tag. Type the first 9 characters of an image tag.
That's correct. Well done!
The correct code:
<img src=
Press Tab or click button to advance to next exercise.
2. The image file is in the images subdirectory of the directory that contains the HTML file. Its name is loris.png. Don't bother with dimensions or alternative text. Fill in the blank.
<img src=______________>
That's correct. Well done!
The correct code:
"images/loris.png"
Press Tab or click button to advance to next exercise.
Press Tab or click button to advance to next exercise.
3. Write the part of the image tag that specifies alternate text. The alternate text is "loris".
That's correct. Well done!
The correct code:
alt="loris"
Press Tab or click button to advance to next exercise.
4. Write the part of the image tag that displays image size. Specify 55 pixels wide and 85 pixels high.
That's correct. Well done!
The correct code:
width="55" height="85"
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 tag. The image file is "founder.jpg", and it's taller than it is wide.
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 an image tag for "loris.jpg" that doesn't include specifications for alternative text or display size. The image file is in the same directory as the HTML file.
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.
Fill in the blank. The alternative text is "logo" and the image is 100 pixels square.
<img src="mark.png" ________________________>
Press Tab or click button to advance to next exercise.
That's correct. Well done!
8. What is the keyword that puts an image and a heading on the same line?
That's correct. Well done!
The correct code:
float
Press Tab or click button to advance to next exercise.
9. What is the keyword that expands the space around the image and forces the div to expand to accomodate it?
That's correct. Well done!
The correct code:
margin
Press Tab or click button to advance to next exercise.
10. Code the first line for styling any image inside a div with the ID "block".
That's correct. Well done!
The correct code:
div#block img {
Press Tab or click button to advance to next exercise.
11. Style any image inside the div with an ID of "header" that places the image on the left of a heading that's also inside the div.
That's correct. Well done!
The correct code:
div#header img {
float: left;
}
Press Tab or click button to advance to next exercise.
12. Style any image within a div. Float it left. Give it some margin on the top, bottom, and left, using one line of code. Make up the div ID. Make up the margin amounts.
That's correct. Well done!
Example:
div#header img {
float: left;
margin: 1% 0 1% 1%;
}
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. Fill in the blank. The alternative text is "logo" and the image is 100 pixels square.
<img src="mark.png" ________________________>
Press Tab or click button to check answer.
The correct code:
alt="logo" width="100" height="100"
Press Tab or click button to advance to next exercise.
Press Tab or click button to advance to next exercise.
14. Time goal: 10 seconds. What is the keyword that puts an image and a heading on the same line?
Press Tab or click button to check answer.
The correct code:
float
Press Tab or click button to advance to next exercise.
Press Tab or click button to advance to next exercise.
15. Time goal: 10 seconds. What is the keyword that expands the space around the image and forces the div to expand to accomodate it?
Press Tab or click button to check answer.
The correct code:
margin
Press Tab or click button to advance to next exercise.
Press Tab or click button to advance to next exercise.
16. Time goal: 15 seconds. Code the first line for styling any image inside a div with the ID "block".
Press Tab or click button to check answer.
The correct code:
div#block img {
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. Style any image inside the div with an ID of "header" that places the image on the left of a heading that's also inside the div.
Press Tab or click button to check answer.
The correct code:
div#header img {
float: left;
}
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. Style any image within a div. Float it left. Give it some margin on the top, bottom, and left, using one line of code. Make up the div ID. Make up the margin amounts.
Press Tab or click button to check answer.
Example:
div#header img {
float: left;
margin: 1% 0 1% 1%;
}
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