📡 You're offline — showing cached content
New version available!
Quick Access
Tutorials HTML Fundamentals Print CSS

Print CSS

4 min read
Use @media print to hide navigation and show link URLs with a::after { content: attr(href) }. Set page margins with @page { margin: 2cm }. Use page-break-inside: avoid to keep tables on one page.

Print Stylesheets

<!-- Link a print stylesheet -->
<link rel="stylesheet" href="print.css" media="print">

<!-- Or use @media in CSS -->
@media print {
    nav, footer, .ads { display: none; }
    body { font-size: 12pt; }
    a::after { content: " (" attr(href) ")"; }
    @page { margin: 1in; }
}