1. To make your site responsive, you use _____ _______.
That's correct. Well done!
The correct answer:
media queries
Press Tab or click button to advance to next exercise.
2. What are the first six characters of a media query?
That's correct. Well done!
The correct code:
@media
Press Tab or click button to advance to next exercise.
Press Tab or click button to advance to next exercise.
3. The following media query is going to be for a screen, not a _______.
@media only screen and ....
That's correct. Well done!
The correct answer:
printer
Press Tab or click button to advance to next exercise.
4. This media query is going to specify minimum and maximum screen dimensions. Fill in the blank.
@media only screen ___
That's correct. Well done!
The correct code:
and
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 the first line of a media query.
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 four words of the media query I've used as an example.
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 to specify a minimum width of 320 pixels.
@media only screen and _______________________
Press Tab or click button to advance to next exercise.
That's correct. Well done!
8. Fill in the blank to specify a maximum width of 480 pixels.
@media only screen and (min-device-width: 320px) and _________________________
That's correct. Well done!
The correct code:
(max-device-width: 480px)
Press Tab or click button to advance to next exercise.
9. Code the first line of a media query, where you're testing for a laptop or desktop and are skipping the maximum-width test. The minimum width is 1224 pixels.
That's correct. Well done!
The correct code:
@media only screen and (min-device-width: 1224px) {
Press Tab or click button to advance to next exercise.
10. The first line of a media query has been coded. Code the next two lines specifying that images are not to be displayed inline. Indent correctly.
That's correct. Well done!
The correct code:
img {
display: block;
Press Tab or click button to advance to next exercise.
11. Code the first line of a media query, screen only, testing for both minimum and maximum width. Make up the numbers.
That's correct. Well done!
Example:
@media only screen and (min-device-width: 320px) and (max-device-width: 480px) {
Press Tab or click button to advance to next exercise.
12. Code a media query that checks for 1224-pixels minimum width and no maximum width. If the condition is met, images float left.
That's correct. Well done!
The correct code:
@media only screen and (min-device-width: 1224px) {
img {
float: left;
}
}
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: 25 seconds. Fill in the blank to specify a minimum width of 320 pixels.
@media only screen and _______________________
Press Tab or click button to check answer.
The correct code:
(min-device-width: 320px)
Press Tab or click button to advance to next exercise.
Press Tab or click button to advance to next exercise.
14. Time goal: 25 seconds. Fill in the blank to specify a maximum width of 480 pixels.
@media only screen and (min-device-width: 320px) and _________________________
Press Tab or click button to check answer.
The correct code:
(max-device-width: 480px)
Press Tab or click button to advance to next exercise.
Press Tab or click button to advance to next exercise.
15. Time goal: 55 seconds. Code the first line of a media query, where you're testing for a laptop or desktop and are skipping the maximum-width test. The minimum width is 1224 pixels.
Press Tab or click button to check answer.
The correct code:
@media only screen and (min-device-width: 1224px) {
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. The first line of a media query has been coded. Code the next two lines specifying that images are not to be displayed inline. Indent correctly.
Press Tab or click button to check answer.
The correct code:
img {
display: block;
Press Tab or click button to advance to next exercise.
Press Tab or click button to advance to next exercise.
17. Time goal: 80 seconds. Code the first line of a media query, screen only, testing for both minimum and maximum width. Make up the numbers.
Press Tab or click button to check answer.
Example:
@media only screen and (min-device-width: 320px) and (max-device-width: 480px) {
Press Tab or click button to advance to next exercise.
Press Tab or click button to advance to next exercise.
18. Time goal: 85 seconds. Code a media query that checks for 1224-pixels minimum width and no maximum width. If the condition is met, images float left.
Press Tab or click button to check answer.
The correct code:
@media only screen and (min-device-width: 1224px) {
img {
float: left;
}
}
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