Old 22-04-2004, 11:40   #1 (permalink)
Alex
div
 
Alex's Avatar
 
Join Date: Feb 2004
Location: Leeds
Posts: 646
Send a message via MSN to Alex
print css help

Basically I've got a print.css stylesheet that I'm linking to via @import command.

The problem is that, in ie5 and 5.5 for some reason they use the print stylesheet as the main stylesheet for the page, even though it contains the media="print" command. This obviously messes the whole layout as in the print stylesheet I'm hding a lot of the #divs which I dont want to be printed.

As usual it all works fine in ie6,mozilla etc.

A google shows other people have had the same problem, but I cant find a bloody solution!

Can anyone help?

the css..

Quote:
<style type="text/css" media="screen, projection">
@import url(style/<?php echo $stylesheet;?>);
</style>
<style type="text/css" media="print">
@import url(style/print.css);
</style>
__________________
  Reply With Quote
Old 22-04-2004, 11:50   #2 (permalink)
smallbeer
I Ain't Losing Any Sleep™
 
Join Date: Apr 2003
Posts: 5,200
dunno if this will made a difference but try
Code:
<style type="text/css"> @import url(style/print.css) print; </style>
__________________
That's fuckin' ingenious, if I understand it correctly. It's a Swiss fuckin' watch.
  Reply With Quote
Old 22-04-2004, 11:58   #3 (permalink)
Brown
volkswagen yellow & gold
 
Brown's Avatar
 
Join Date: Apr 2003
Location: london, england.
Posts: 6,147
why @import it? anything that doesn't understand @import will not understand the print anyway. no?
  Reply With Quote
Old 22-04-2004, 12:17   #4 (permalink)
Alex
div
 
Alex's Avatar
 
Join Date: Feb 2004
Location: Leeds
Posts: 646
Send a message via MSN to Alex
hmm <link rel> instead of @import seems to fix it now....i`m sure I tried that earlier. Oh well

Cheers 4 replies
__________________
  Reply With Quote
Old 22-04-2004, 12:19   #5 (permalink)
smallbeer
I Ain't Losing Any Sleep™
 
Join Date: Apr 2003
Posts: 5,200
Quote:
Originally Posted by BoGeYMaN
hmm <link rel> instead of @import seems to fix it now....i`m sure I tried that earlier. Oh well

Cheers 4 replies
Were you trying to hide from NN4.x? AFAIK, NN4 will ingore the media type and use the styles regardless if you link them.

I might be talking shit though.
__________________
That's fuckin' ingenious, if I understand it correctly. It's a Swiss fuckin' watch.
  Reply With Quote
Old 22-04-2004, 12:29   #6 (permalink)
smallbeer
I Ain't Losing Any Sleep™
 
Join Date: Apr 2003
Posts: 5,200
I think I was.
__________________
That's fuckin' ingenious, if I understand it correctly. It's a Swiss fuckin' watch.
  Reply With Quote
Old 22-04-2004, 12:33   #7 (permalink)
Bill Posters
trouble free and loverlee
 
Join Date: Mar 2003
Location: YooKay
Posts: 2,933
I'm always confused where folk keep getting the idea to use <link> tags with media attributes.

I know it's valid, but it's not a method I've seen being pimped anywhere.
Is it the preferred MO of one or other of those iffy wsyiwyg packages?

@import, baby. End of.
  Reply With Quote
Old 22-04-2004, 12:52   #8 (permalink)
smallbeer
I Ain't Losing Any Sleep™
 
Join Date: Apr 2003
Posts: 5,200
I dunno bill.

http://www.alistapart.com
http://www.stopdesign.com
http://www.meyerweb.com/

all seem to be using one or other of those iffy wsyiwyg packages.
__________________
That's fuckin' ingenious, if I understand it correctly. It's a Swiss fuckin' watch.
  Reply With Quote
Old 22-04-2004, 13:35   #9 (permalink)
Alex
div
 
Alex's Avatar
 
Join Date: Feb 2004
Location: Leeds
Posts: 646
Send a message via MSN to Alex
I agree Bill, but like i just said, If i used import to link to the print css as well as main main css, it was overriding my main css selectors, and borking the page up. The only solution seems to be using @import for my main css file, and <link> for the print one to overcome what is basically and ie5.0 and 5.5 glitch...

__________________
  Reply With Quote
Old 22-04-2004, 13:51   #10 (permalink)
Brown
volkswagen yellow & gold
 
Brown's Avatar
 
Join Date: Apr 2003
Location: london, england.
Posts: 6,147
change the order of your imported stylesheets in your html code - might make a difference.

or carry on with it as it is seeing as its working...
  Reply With Quote
Reply



Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search


Contact Us - Web Design Forums - Archive - Top
Search Engine Optimization by vBSEO 3.0.0 RC8