RC RANDOM CHAOS

Make Your Website Printable With CSS Media Queries

· via Hacker News

Original source

Websites Should Be Printable

Hacker News →

The author wanted to enable people to print their website after noticing that marking up printed documents helps them focus. An initial print test revealed poor formatting: oversized text, an ugly header, and gray hyperlinks on a black-and-white page. Using CSS @media print selectors, the author implemented fixes including font-size adjustments (12pt for body text, scaling up to 16pt for h1), hiding the navigation header from prints, and changing link colors to black for grayscale.

The work took significant effort despite the site’s simplicity. Code blocks remain aesthetically problematic—they resist breaking across page boundaries. The author acknowledges uncertain demand but argues that text-heavy websites benefit from supporting the print medium since it’s simply another way users might prefer to consume content. They share their CSS openly and call on other developers to consider print-friendly design as a small courtesy to users.

Read the full article

Continue reading at Hacker News →

This is an AI-generated summary. Read the original for the full story.