Print versions of websites

Written by Shanx November 9th, 2002

Print versions of websites

Continue reading →
Close

With some CSS based trickery, you can provide those “PRINT THIS” versions of your pages without much effort. May be old hat to some (since almost all major browsers support the alternate stylesheets since 5.x versions) but very useful. Well, that, and a useful way to print links in a printed page with only CSS

If you’re using CSS to style your sites, even if you’re doing a tabled layout, use a print stylesheet to hide the parts that don’t need to be printed, and reduce the colors to black and white (if appropriate).

The call is simple:

<link rel="stylesheet" type="text/css" href="print.css" media="print">

This will work in most 5.x browsers.

Consider embedding print-friendly logos in the page as well, and
setting them not to display in the page, but to display when printed.
In your print.css file, you can change the colors of all your text
and page colors to black on white, reset your font sizing units, hide
your navigation bars (consider keeping any breadcrumb trails and
basic contact information), and generally get more space for the
content of the page without eating all the colored ink in your user’s
printer.

Sample sites (use print preview in your browser to see how each looks
without wasting the paper):

With a little more code, you can even get the URLs of your hyperlinks
to appear with the hyperlinked text in more standards-compliant
browsers:

a:after{content : " [" attr(href) "] " ; }

Posted in Miscellaneous

1 Comment

Tagged with

One Comment

  1. Marc says:

    This is a super tip and will save us many hours coding alternate templates for printing!

Leave a Reply

Miscellaneous

I use the Nokia e61i as my mobile. Instead of my telco’s data plan (which offers me a meagre 1GB per month) I simply prefer to use my home wireless [...]

Continue reading →

View all

Web Tools

If you use Firefox (and if not, what are you waiting for?) you are familiar with useful extensions such as Video Downloader, which allow you to save local copies of [...]

Continue reading →

View all

Databases

This regexp worked for me. SELECT * FROM table WHERE NOT column ~ ( ‘^(‘|| $$[\09\0A\0D\x20-\x7E]|$$|| — ASCII $$[\xC2-\xDF][\x80-\xBF]|$$|| — non-overlong 2-byte $$\xE0[\xA0-\xBF][\x80-\xBF]|$$|| — excluding overlongs $$[\xE1-\xEC\xEE\xEF][\x80-\xBF]{2}|$$|| — straight 3-byte [...]

Continue reading →

View all

Windows

So you’ve been visited by the much dreaded CRC — Cyclical Redundancy Check error, most likely encountered while copying files between hard disks. On Mac OSX, this will usually appear [...]

Continue reading →

View all

Mac OSX

A simple app ought to do it. Download iRinger. It’s a Windows app. If you’re on Mac, you’ll want to use it within a virtual machine, like Parallels or VMWare [...]

Continue reading →

View all

System Maintenance

I use the Nokia e61i as my mobile. Instead of my telco’s data plan (which offers me a meagre 1GB per month) I simply prefer to use my home wireless [...]

Continue reading →

View all

Wordpress

Among many new exciting features, WordPress 2.6 released the ability to store each and every revision of your posts, like an elaborate update history. Now this can be a pretty [...]

Continue reading →

View all

Audio/Video

Panic, the makers of some fantastic software such as Transmit or Panic, also have the most light-weight audio converter for the Mac OSX platform. It’s called Audion: get it here. [...]

Continue reading →

View all

iPhone

A simple app ought to do it. Download iRinger. It’s a Windows app. If you’re on Mac, you’ll want to use it within a virtual machine, like Parallels or VMWare [...]

Continue reading →

View all