Blog
Save a tree with a print stylesheet
Sometimes you just need to print a web page. Perhaps a recipe for something you want to cook, or a list of items you want to order.
Nothing is more infuriating then printing a page and ending up with a stack of paper containing every single element of the web page: banners, adverts, navigation blocks, social media widgets, etc. Easy solution is to add a print stylesheet to your website, which omits all those things. Making everyone happy and saving some trees in the process.
If you use media queries to target different screen sizes then a printer will ignore what’s in these media queries, except if you include "print" in the media query. And it seems to like being first in the list.
Like this:
@media print, screen { ... }