Today is a good day to code

Internet Explorer Doesn’t Support CSS Media Attribute

Posted: December 31st, 1969 | Author: | Filed under: Uncategorized | No Comments »

Internet Explorer Doesn't Support CSS Media Attribute

Picture of IrvinWell, that is not entirely true. It does support the media attribute, for the link tag. What it doesn't support is the media='screen and (min-device-width:481px).'

Basically what happens is that all other browsers read that stylesheet for devices with widths larger than 481px. IE however, ignores that stylesheet, instead using none. So, for the current time, it is better to use a server side scripting language to include the correct stylesheet for the desired user agent string. You could also use JavaScript, but if your stylesheets include other mobile browser types, you might end up with using DOM scripting methods that don't function on a particular device.

It really stinks that we have to use scripting to handle tasks that could be done client side in the browser. I don't understand why while most browsers see the space as the end of the string, and don't recognize anything beyond the first word, IE insists on being able to understand everything and because Microsoft doesn't pay attention to standard implementation, executing it in some strange way.

Perhaps one day Microsoft will understand that their role is to “be-the-platform” not to define how technology will be used. If they were smart, they would make Windows and Office as interoperable as possible. They would release Office and Direct X for Windows. In the process C# would crush Java, and they would win. But its their closed minded, closed source approach to the world that will, if not changed, eventually be their end.