homepage Welcome to WebmasterWorld Guest from 54.205.247.203
register, free tools, login, search, pro membership, help, library, announcements, recent posts, open posts,
Become a Pro Member
Home / Forums Index / Code, Content, and Presentation / HTML
Forum Library, Charter, Moderators: incrediBILL

HTML Forum

    
CSS not being picked up when Printing from IE6
CSS Printing IE6
pmrco




msg:3524618
 12:22 am on Dec 11, 2007 (gmt 0)

Hi All,

I've an issue that I can't seem to find any information on despite having googled for a while. The jsp pages on our site displays fine in a variety of browsers including IE6. When I try to print from IE6 however all formatting is lost. The pages print fine from Firefox, Safari etc but not IE6. The odd thing is that if I save one the pages locally as html, then open it up in IE6 and print out, it outputs the page to the printer with the correct CSS. It appears as though the CSS is not being picked up at all when we print from IE6. Our CSS files are declared thus:

<link rel="stylesheet" media="all" type="text/css" href="main.css" />
<link rel="stylesheet" media="all" type="text/css" href="apps.css" />
<!--[if gte IE 6]>
<link rel="stylesheet" media="all" type="text/css" href="ie6.css" />
<![endif]-->
<link rel="stylesheet" media="print" type="text/css" href="print.css" />

The print.css file overrides some styles in main.css so that it prints ok (at least on browsers other than IE6). It renders fine in all browser windows so I'm at a loss as to why it wouldn't print ok.

Does anyone have any experience of this or know what the cause/solution may be? Thanks in advance for your help.

Cheers,
pmrco.

 

pmrco




msg:3524628
 12:34 am on Dec 11, 2007 (gmt 0)

Doc type is:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

2lame2rank




msg:3525124
 4:02 pm on Dec 11, 2007 (gmt 0)

Hello pmrco, I believe it is traditional here to say welcome to new members, so welcome to you!

I would try a few different things first to find the bug. try placing the print stylesheet before the one in the conditionel comment. also try changing "all" to "screen" for the general stylesheets.

Also are you saying that the print stylesheet is having no effect at all in IE? If you add it twice (once between the conditional comment) does that help?

Hope that helps find the cause!

pmrco




msg:3525365
 8:54 pm on Dec 11, 2007 (gmt 0)

Thanks :)

I've tried all the different combinations of the stylesheets, eliminating them one by one, including only one, including only a cut-down version with simple css formatting etc. All produce the same result with IE6 not including the css in the printed output (or in print preview).

I don't think that changing the media type from "all" to "screen" is ideal as the print.css just overrides a few styles in the other stylesheets (e.g. hides the lhs navigation etc). Making it "screen" would mean that it wouldn't be available to printed media wouldn't it?

I tried including all four stylesheets within the conditional comments but still IE6 wouldn't pick up any styles when printing.

Thanks for the help so far.

Global Options:
 top home search open messages active posts  
 

Home / Forums Index / Code, Content, and Presentation / HTML
rss feed

All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
Home ¦ Free Tools ¦ Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About ¦ Library ¦ Newsletter
WebmasterWorld is a Developer Shed Community owned by Jim Boykin.
© Webmaster World 1996-2014 all rights reserved