Previous Message
Next Message

IE6: @import directive vs. media ???

Sent by Syntactic: Jim Wilkinson on 14 August 2004 08:08


Hi Michael,

>> >     <style type="text/css">
>> >     @import url("/css/real.css") screen;
>> >     @import url("/css/unreal.css") screen;
>> >
>> >     </style>

> I am using CGI.pm, and want to @import style sheets for particular
> media.  I have not found a way to add media="screen" to the style tag
> using CGI.pm.  I found a way to do the above; but, it does not seem to
> be recognized by IE6.

Your syntax is valid but, in general, support for @import is not fully  
robust across browsers. In your case, you are using @import with a medium  
specified *and* you have enclosed them in a <style> element (without a  
medium specified). That combination might well be too complex for IE6 to  
handle.

My suggestion would be to avoid specifying media on @import, e.g. you  
could have:-

<link rel="stylesheet" href="basic.css" type="text/css">
<style type="text/css">
<!-- @import "notns4orie4.css"; -->
</style>
<link rel="stylesheet" href="print.css" type="text/css" media="print">
<link rel="stylesheet" href="handheld.css" type="text/css"  
media="handheld">

See also the Wiki:-

http://css-discuss.incutio.com/?page=MediaStylesheets

-- 
Jim Wilkinson

Cardiff, Wales UK

Opera e-mail client: http://www.opera.com/m2/
______________________________________________________________________
css-discuss [EMAIL-REMOVED]]
http://www.css-discuss.org/mailman/listinfo/css-d
List wiki/FAQ -- http://css-discuss.incutio.com/
Supported by evolt.org -- http://www.evolt.org/help_support_evolt/
Previous Message
Next Message

Message thread: