The more I use IE7, the more I hate it. Yes, it’s more standards-compliant and feature-rich than IE6; but if the best you can say about your browser is that it’s better than IE6, you’re not starting from a strong position. IE7 is better than IE6 as receiving ten smacks in the head is better than receiving twelve.
The reason I’m annoyed at IE7 today is that I’ve just found out they still haven’t implemented media types on the @import rule. If you’re not sure what this is, it’s a shorthand way to apply stylesheets only to specific media. Say, for example, we want to apply an external stylesheet called print.css which will apply only to printed documents; easy enough, you just do this:
<style type="text/css">
@import url('print.css') print;
</style>
Easy, right? Not for IE7, no. It just doesn’t read the stylesheet at all. OK, there are a number of alternatives to this;
<style type="text/css" media="screen">
@import url('print.css');
</style>
for example; or just using the plain old link element:
<link rel="stylesheet" href="print.css" media="print">
But that’s not the point. Using media types on the @import rule was implemented in CSS2, which became a release candidate in 1998. That’s at least eight years that the IE team have had to think about implementing this. If they already support media types in the link and style elements, how hard could it have been to add it to the @import rule?
Jade R. [November 5th, 2007, 4:25 pm; Permalink]
Thanks for the writeup on this, it had been confusing me for a while why my @import statements weren’t working in IE7… I never even thought this would be a feature they have yet to implement. It’s really a shame.
kiat [November 7th, 2007, 6:47 am; Permalink]
indeed, they should have implemented this long time ago. :(
More findings from IE8: XHTML and @import » Broken Links [March 7th, 2008, 3:53 pm; Permalink]
[…] chance to run a few more tests to find out what’s new (and what’s not) in IE8. Good: @import media types seem to be implemented; Bad: XHTML still isn’t parsed, so everyone who thinks they are coding […]