A genuine Silicon Valley Web Flyer | One line of code at a time...

Print style sheets are simple, but important.

We claim to live in a paperless society, but it’s always good to have something tangible to hold on to, regardless of its electronic signifigance.

Printing simple information on the web will sometimes yield five or six useless pages. This is not only bad for the environment, but if people are hesitant about printing documents from your website, you will lose a percentage of your audience.

Here is a Print Preview of one of my blog posts:

Before print.css
CSS Before

After print.css
CSS After

I turned six pages into one page with a few lines of CSS:


body {
font-family: Georgia, "Times New Roman", Times, serif;
}

#header, .navwidthbg, h2, , #errors, #commentsform, #sidebar,  {
display: none;
}

h3 {
font-size: 2em;
margin-top: -10px;
}

p {
font-size: 10px;
}

Simple as that. With a WordPress blog, all you have to do is add this code to the header.php file:

This easy code allows people to print your blog posts easily without all the sidebar crap.

    blog comments powered by Disqus