Disclosure: I work on VibUI, a paid library of website prompts. It's linked once, at the end.
A customer calls. "I tried to print your price list for my boss and it came out as six pages. The first one is just your logo on a black background, and the prices got cut in half." You open the page, press print, and watch the preview agree with them.
Nobody prints web pages any more, apart from the people who do: office managers, parents with a schedule, someone saving a menu, a client who wants a signed copy of the quote. AI-built pages almost never include print styles, because nobody asks. Twenty-five lines fix most of it.
The stylesheet
@page { margin: 18mm; }
@media print {
body {
background: #fff;
color: #000;
font-size: 11pt;
line-height: 1.4;
}
/* Things that make no sense on paper */
nav, .cookie-bar, .carousel-controls, video, iframe, button { display: none; }
/* Show where links go */
a[href^="http"]::after { content: " (" attr(href) ")"; font-size: 0.85em; }
/* Don't strand a heading at the bottom of a page */
h1, h2, h3 { break-after: avoid; }
/* Keep these blocks whole */
table, figure, .card, .price-row { break-inside: avoid; }
img { max-width: 100%; }
}
What each part solves
| Problem on paper | Fix |
|---|---|
| Black or coloured page backgrounds waste ink | Force a white background and dark text |
| Menus, banners and videos print as blanks or clutter | Hide them with display: none
|
| Links are invisible, so a printed page loses its references | Print the URL after external links |
| A heading sits alone at the bottom of a page | break-after: avoid |
| A price table splits across two pages | break-inside: avoid |
| Text too small or too large | Set a print size in points |
Gotchas
- Browsers usually drop background colours and images when printing. If you need one (a coloured table header, say), add
print-color-adjust: exact;to that element, and expect some visitors to still turn backgrounds off. - Sticky and fixed elements can repeat on every page or overlap content. Set
position: staticfor them inside the print block. - Lazy-loaded images below the fold may not have loaded. Test by scrolling the whole page before printing.
- Print the full URL only if it helps. For internal links, you might skip it with a narrower selector.
Test it
- [ ] Press Ctrl or Cmd + P and look at the preview
- [ ] Choose "Save as PDF" and open the result
- [ ] Check the longest page, the one with a table
- [ ] Try black-and-white printing
- [ ] Look at it at A4 and Letter sizes
Ask the tool for it
Add a print stylesheet. White background, black text, 11pt body. Hide navigation, banners, videos,
embeds and buttons. Print external link URLs after the link text. Avoid page breaks inside tables,
cards and price rows, and avoid headings at the bottom of a page. Don't change screen styles.
It's a short, clear request, and it works in v0, Lovable, Bolt, Cursor, Windsurf, Claude, ChatGPT, Gemini, Replit, GitHub Copilot, Framer AI, Google Stitch, Readdy, Aura.build, OpenAI Codex. Tell the tool which pages matter most for printing (pricing, menu, schedule), so it tests those.
A small plug
Pages with clean table and card markup print better. If you want sections like that to start from: VibUI has 2,852 website prompt templates: 775 pages, 1,100 sections, 817 components, 160 animated backgrounds, about 1,000 with source code. One-time payments, no auto-renewal: $48 quarterly, $99 yearly, $179 lifetime (down from $384); yearly and lifetime include 2,407 AI video prompts. 60 free samples, and a free account can copy 2 prompts. Open a free sample with source code and press print on it.
Top comments (1)
The break-inside: avoid on table and .price-row is the part that would have saved the "prices got cut in half" bug. break-after: avoid on headings is the other one people forget until a section title is orphaned at the bottom of a page.
I'd be careful with a[href^="http"]::after { content: attr(href) } on a pricing page though. If every CTA is an absolute URL, you can end up printing a wall of long query-string links and pushing the actual prices onto another page — the problem you started with. A narrower selector, or only printing hrefs that don't match the current host, keeps the useful references without making the page noisy.
The lazy-loaded image gotcha is also easy to miss in the print preview: if you open the dialog from the top of the page, images below the fold may still be placeholders. Scrolling first, or using loading="eager" on anything that must appear on paper, is worth putting in the test list.