HTML & CSS · Middle · Question 50 of 75

How do you properly include print-only styles?

Explanation

media="print" and @media print apply styles only when printing: hide navigation and ads, remove backgrounds, show link URLs via a::after { content: " (" attr(href) ")" }, control page breaks with break-inside: avoid. window.print() only opens the print dialog.

Further reading

Problem with a question

HTML & CSS · Middle · question 50

Test yourself

Take the HTML & CSS · Middle quiz: questions and options are shuffled, and you get a review of your mistakes at the end.

Take this quiz