Skip to content

Instantly share code, notes, and snippets.

@mathiasrw
Created March 4, 2024 16:39
Show Gist options
  • Save mathiasrw/109c22976453e35760b16292e750a416 to your computer and use it in GitHub Desktop.
Save mathiasrw/109c22976453e35760b16292e750a416 to your computer and use it in GitHub Desktop.
@media print {
h2, h3, h4, h5, h6 { break-after: avoid-page; }
img, svg, table, canvas { break-inside: avoid; }
a::after { content: " (" attr(href) ")"; }
}
@mathiasrw
Copy link
Author

From https://news.ycombinator.com/item?id=39587272

Explanation:

  • Avoid printing section headers at the bottom of one page with the section content left headerless at the top of the next page.

  • Prefer printing graphics and figures on whole pages instead of split across pages.

  • Print out the URL of every hyperlink instead of having links only as useless underlined text.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment