Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

losing the css when printing

Status
Not open for further replies.

famtek

Instructor
Mar 27, 2007
67
US
Am running IE6 and Safari and get identical results. When I visit laptop.org, page displays fine. When I print it, you can tell the CSS file disconnects and I print only content without styles. How can I make sure when I print I retain the CSS style in the hard copy.

thanks
 
Are you talking about this particular page because you designed it, or because you want to print this very page?

When writing CSS, you can specify which medium should be using the styles specified. If media attribute is omitted, then all media uses it. On the mentioned page, the main stylesheet applies to the medium "screen", meaning on your computer screen. There is a second stylesheet that applies to "print", which means for printed material. This was designed because most people do not want to print navigation menus, ad boxes and other web related features that have no value on the printed paper.

So, in the case of laptop.org, you cannot print the screen version at this point. If you can change the page, then you would omit the media attribute from the main stylesheet.

On your page, you simply decide if you want a separate stylesheet for printing (media="print"), or if you simply want a couple of changes to your main stylesheet (no media attribute or media="all"). I usually work from the main stylesheet (to retain the usual page look and feel) and remove all the unnecessary graphics and element sections (searches, navigation buttons, etc).

___________________________________________________________
[small]Do something about world cancer today: PACT[/small]
 
Because I was tp print this very page.
 
So, you cannot do anything. This was by design of the website designer.

___________________________________________________________
[small]Do something about world cancer today: PACT[/small]
 
You could save the page (and associated files) to your hard disk, change the links to the stylesheets to get rid of the print one, then print out the local copy.

Or you could take a series of screenshots, piece them together in a graphic editing program, then print out the resulting image.

[sub]Never be afraid to share your dreams with the world.
There's nothing the world loves more than the taste of really sweet dreams.
[/sub]

Enable Apps
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top