No print - CSS

March 19th, 2007

Ok I told everyone I figured out working with a client how to make a visitors browsers only print certain parts of your site which you specified. Well, here is how its done using css. In your header tags you want to link to 2 style sheets like below:

Now when a visitor pulls your site up it will automatically use the style.css, and when they click file print it will use your print.css!

So make your style.css normal and in your print.css things you dont want to show when printed simply use the command display:none;

For instance I didn’t want my header to print out I would do:

#header{
display:none;
}

I hope this helps some people instead of having to research it like I did ;)


Leave a Reply