CSS, Internet Explorer and the magic !ie

I came across this strange bit of CSS tonight...

display: inline !ie;

Now I've created and seen a lot of CSS and I have never seen this before or its magical powers.

You can add "!ie" at the end of any rule and it will only be applied by M$ Internet Explorer 6 & 7

Can anyone shed any light on this WTF?

Answers


Internet Explorer 7 and below have a few quirks related to the !important declaration, which is supposed to give a value higher importance than normal.[3] IE7 and earlier accept virtually any string in place of important and process the value normally, while other browsers will ignore it.

Taken from !Important Quirks section in CSS Filter - Wikipedia


At a guess, I would say that Internet Explorer tries to recover from what is quite clearly an error. The following would also work:

display: inline !pudding;

The specification says that if an invalid value is specified or an error occurs in a rule it should be ignored. It looks like most browsers stick to this but IE recovers for this specific situation.

In some cases, user agents must ignore part of an illegal style sheet. This specification defines ignore to mean that the user agent parses the illegal part (in order to find its beginning and end), but otherwise acts as if it had not been there.

http://www.w3.org/TR/CSS21/syndata.html#parsing-errors


Need Your Help

Maven error with multiple executions in maven-deploy-plugin

java maven-2 build maven-plugin

I found this nice recipe and want to use it to deploy some 3rd-party files in our repository

Goto was unexpected at this time batch windows 7 starter

windows-7 batch-file goto

This code is designed to resemble a simpler version of the Pokemon battle gameplay. I've only coded in the attacks. I've been testing thoroughly, and found that an error message (Goto was unexpecte...