1. It's possible to make elements overlap when positioning is relative, absolute, or _____.
That's correct. Well done!
The correct answer:
fixed
Press Tab or click button to advance to next exercise.
2. It's possible to make elements overlap when positioning is fixed, relative, or ________.
That's correct. Well done!
The correct answer:
absolute
Press Tab or click button to advance to next exercise.
Press Tab or click button to advance to next exercise.
3. It's possible to make elements overlap when positioning is absolute, fixed, or ________.
That's correct. Well done!
The correct answer:
relative
Press Tab or click button to advance to next exercise.
4. The type of positioning where nothing can overlap is ____.
That's correct. Well done!
The correct answer:
static or default
Press Tab or click button to advance to next exercise.
5. Drag-and-drop: A div has a z-index of 1. Drag the pieces to layer the heading one layer above it. There are extra pieces you won't use.
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 a line that explicitly sets the z-index to the default.
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 a line that sets the z-index two layers above the default. Don't indent.
Press Tab or click button to advance to next exercise.
That's correct. Well done!
8. Code a line that specifies any of the positioning types that could require a z-index.specification.
That's correct. Well done!
The correct code:
position: absolute [or fixed or relative];
Press Tab or click button to advance to next exercise.
9. Style all paragraphs so they have the default z-index.
That's correct. Well done!
The correct code:
p {
z-index: 0;
}
Press Tab or click button to advance to next exercise.
10. Style a div so it's one layer below the default. Make up the id.
That's correct. Well done!
Example:
div#lower {
z-index: -1;
}
Press Tab or click button to advance to next exercise.
11. Style an image that's in the top-right corner and scrolls. Place it on top of other elements. Make up the id.
That's correct. Well done!
Example:
img#top {
position: absolute;
top: 0;
right: 0;
z-index: 1;
}
Press Tab or click button to advance to next exercise.
12. Style the three smallest headings with the default z-index.
That's correct. Well done!
The correct code:
h4, h5, h6 {
z-index: 0;
}
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: 15 seconds. Code a line that sets the z-index two layers above the default. Don't indent.
Press Tab or click button to check answer.
The correct code:
z-index: 2;
Press Tab or click button to advance to next exercise.
Press Tab or click button to advance to next exercise.
14. Time goal: 20 seconds. Code a line that specifies any of the positioning types that could require a z-index.specification.
Press Tab or click button to check answer.
The correct code:
position: absolute [or fixed or relative];
Press Tab or click button to advance to next exercise.
Press Tab or click button to advance to next exercise.
15. Time goal: 20 seconds. Style all paragraphs so they have the default z-index.
Press Tab or click button to check answer.
The correct code:
p {
z-index: 0;
}
Press Tab or click button to advance to next exercise.
Press Tab or click button to advance to next exercise.
16. Time goal: 30 seconds. Style a div so it's one layer below the default. Make up the id.
Press Tab or click button to check answer.
Example:
div#lower {
z-index: -1;
}
Press Tab or click button to advance to next exercise.
Press Tab or click button to advance to next exercise.
17. Time goal: 70 seconds. Style an image that's in the top-right corner and scrolls. Place it on top of other elements. Make up the id.
Press Tab or click button to check answer.
Example:
img#top {
position: absolute;
top: 0;
right: 0;
z-index: 1;
}
Press Tab or click button to advance to next exercise.
Press Tab or click button to advance to next exercise.
18. Time goal: 30 seconds. Style the three smallest headings with the default z-index.
Press Tab or click button to check answer.
The correct code:
h4, h5, h6 {
z-index: 0;
}
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