Practice - 5 Tasks
Answer the questions below
1fill in blank
easyComplete the code to define a print media query in Sass.
SASS
@media [1] { body { font-size: 12pt; } }
Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'screen' instead of 'print' will apply styles only on screens, not print.
Using 'all' applies styles everywhere, not just print.
✗ Incorrect
The @media print rule targets styles specifically for printed documents.
2fill in blank
mediumComplete the code to hide an element when printing.
SASS
@media print {
.no-print {
[1]: none;
}
} Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'visibility: none' is invalid CSS.
Using 'opacity: none' is invalid; opacity uses numbers.
✗ Incorrect
Setting display: none; hides the element completely in print.
3fill in blank
hardFix the error in the print media query syntax.
SASS
@media [1] {
p {
color: black;
}
} Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Adding a semicolon after 'print' causes a syntax error.
Using 'print screen' is not a valid media type.
✗ Incorrect
The media type should not have a semicolon inside the @media rule.
4fill in blank
hardFill both blanks to create a Sass mixin for print styles and include it.
SASS
@mixin [1] { @media [2] { @content; } } @include print-styles;
Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'screen' instead of 'print' will not target print media.
Mismatch between mixin name and include name causes errors.
✗ Incorrect
The mixin is named print-styles and uses @media print to target print media.
5fill in blank
hardFill all three blanks to create a print-specific style for links inside a Sass print mixin.
SASS
@mixin print-styles {
@media [1] {
a {
color: [2];
text-decoration: [3];
}
}
} Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'screen' media type will not apply styles to print.
Setting text-decoration to 'none' removes underlines.
✗ Incorrect
The media type is 'print'. Links are colored blue and have no underline in print.