Hacker Newsnew | past | comments | ask | show | jobs | submit | theultdev's favoriteslogin

A few of my favorite print styles, from my personal site:

   h2,h3,h4,h5,h6,h7,h8 {break-after: avoid-page;}
   img, svg, table, canvas {break-inside: avoid;}
   a::after {content: " (" attr(href) ")";}

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.


Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: