SyntaxStudy
Sign Up
HTML Intermediate 4 min read

Print Stylesheets

Print Stylesheets

Use @media print to control how a page looks when printed. Hide navigation, ads, and interactive elements.

Print stylesheets improve document readability and save ink.

Example
@media print {
  nav, footer, .ads, button { display: none; }
  body { font-size: 12pt; color: black; }
  a::after { content: " (" attr(href) ")"; }
  .page-break { page-break-after: always; }
}
Pro Tip

Test print styles with browser print preview (Ctrl+P) without wasting paper.