Welcome to WebmasterWorld Guest from 54.226.62.251

Forum Moderators: not2easy

Message Too Old, No Replies

CSS Media="print"

Not working on IE 5.5

     

justa

12:57 am on Jul 31, 2002 (gmt 0)

10+ Year Member



I've just started converting my site's over to XHTML compliance, but I've run into a problem.

My clients want a Online Newsletter for their staff, but they also want them to be able to print it off and take it home. Instead of creating two documents I suggested the below solution.

<style type="text/css" media="print">@import url(print.css);</style>
<style type="text/css" media="screen">@import url(test.css);</style>

When I asked the PR people to print out a couple of pages, one from the old site and one with the different media's, they came back and asked what was so different. Both pages printed out the same way. I'm using the company is using a mix of IE6,5.5 and 5. It works fine on 6 but on the others it seems to ignore the media.

I tried to have a look here [codestyle.org] at the compatibility of CSS2 and browsers, but I'm just not picking it up.

Is this a browser version or settings issue?

tedster

4:59 am on Jul 31, 2002 (gmt 0)

WebmasterWorld Senior Member tedster is a WebmasterWorld Top Contributor of All Time 10+ Year Member



I think I remember hearing that support for @import PLUS @media was still dicey on IE 5 and 5.5. Instead of using <style> tags and @import, does it help to use <link /> instead?

<link rel="stylesheet" type="text/css" href="test.css" media="screen" />
<link rel="stylesheet" type="text/css" href="print.css" media="print" />

Nick_W

7:02 am on Jul 31, 2002 (gmt 0)

WebmasterWorld Senior Member nick_w is a WebmasterWorld Top Contributor of All Time 10+ Year Member



Your best bet may be to put the print stuff in your main styles....

@media print {

.overideyourStylesHere {
display: none;
}
} /* close @media */

The only problem with any of this really is browser support. AFAIK only IE6 supports it in the IE camp and NS6 Opera 6. No IE5+ support I'm afraid...

Nick

justa

11:12 am on Jul 31, 2002 (gmt 0)

10+ Year Member



I have replaced the previous with <link rel="stylesheet" type="text/css" href="test.css" media="screen" />
<link rel="stylesheet" type="text/css" href="print.css" media="print" />

It still works fine when I print, I'll be back tomorrow if it's still buggy on others. Cheers for the help.

 

Featured Threads

Hot Threads This Week

Hot Threads This Month