The contact page with the

CSS print stylesheet

You’ve seen them before: links that say “click here for printer-friendly version” or words to that effect. Every time you follow one of those links, you load a separate document that presents exactly the same information with a different layout, and probably different markup.

Article Continues Below

That means somebody (or a script) had to take the original document and convert it to a stripped-down version that’s more suitable for print output. Maybe that somebody was even you.

Print style sheets to the rescue

One of the wonderful things about CSS is that it allows authors to create media-specific styles for a single document. We’re pretty used to styling for the screen, but thinking about other media isn’t a habit yet. And as all the “printer-friendly” links attest, our thinking about the print medium has been limited to recreating a document in a different way.

Why bother, when the power to offer your readers a better view of your material in print is no further away than a well-structured document and a media-specific style sheet?

You can take any (X)HTML document and simply style it for print, without having to touch the markup. Worries about version skew between the web and print versions suddenly become a thing of the past. Best of all, it’s simple to do. (For more information on the basic principles involved in creating media-specific stylesheets in general and print styles in particular, see “Print Different” at meyerweb.com.)

Let’s look at how A List Apart got some new print styles that danced around a browser bug and, in the end, made the printed output look much better.

Fixing a float flub

As you can see by visiting Bugzilla entry #104040, Gecko-based browsers like Netscape 6.x or Mozilla have a problem with printing long floated elements. If a floated element runs past the bottom of a printed page, the rest of the float will effectively disappear, as it won’t be printed on the next page.

If you have a site styled like A List Apart, and the entire article content is contained in one big float, then that means readers will only get the first page of the article.

Interesting facts
  • Take Me Out is a British comedy dating game show show hosted by Paddy McGuinness. It began airing on ITV1 in the UK and TV3 in the Republic of Ireland on 2 January 2010. The pilot episode was for Channel 4 in 2009. It is based on the original Australian show Taken Out. In September 2010, Irish broadcaster TV3 started broadcating an Irish...
You might also like
Blueprint CSS Part 1 - Content Based Grid Layouts
Blueprint CSS Part 1 - Content Based Grid Layouts
WordPress Printer Friendly CSS
WordPress Printer Friendly CSS
Create Print-Friendly Web Pages with CSS - Pt 2
Create Print-Friendly Web Pages with CSS - Pt 2
Softpress Systems Freeway 7 Pro [Download]
Digital Software (Softpress Systems)
  • Create responsive websites on your Mac without writing any code
  • Set up shop and start selling your wares right now with built in ecommerce tools
  • Intelligent & secure uploads - When you upload, Freeway only uploads what s necessary. Saving you precious time, and bandwidth.
  • Master pages, which are just like templates for the pages within your site, will stop you having to recreate common elements over and over again
  • Freeway manages your pages, folders, colors, styles, and links. Leaving you to get on with the stuff that matters.
Related Posts