HTML/CSSAdvanced#css#media-queries

How do you make a webpage print-friendly using CSS?

Use a @media print query to hide non-essential elements (nav, ads, buttons), adjust colors for ink-saving (avoid dark backgrounds), and control page breaks with break-inside/break-before properties.

Example
@media print {
  nav, footer, .no-print { display: none; }
  body { color: black; background: white; }
  .card { break-inside: avoid; }
}

Related Questions

1
HTML/CSSIntermediate#css#media

What is the CSS 'object-fit' property used for?

Open
2
HTML/CSSBeginner#html#entities

What is the difference between HTML entities and Unicode characters?

Open
3
HTML/CSSBeginner#html#attributes

What is the difference between the id and class attributes?

Open