CSS Filter - !important Quirks

!important Quirks

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. IE7 and earlier accept virtually any string in place of important and process the value normally, while other browsers will ignore it. This can be used to specify values exclusively for these browsers.

/* Make text blue in IE7 and below, black in all other browsers */ body { color: black; color: blue !ie; }

Similarly, IE7 and earlier accept non-alphanumeric characters after an !important declaration, while other browsers will ignore it.

body { color: black; color: blue !important!; }

Both of these hacks use invalid CSS. Internet Explorer 6 and below also have a problem with !important declarations when the same property of the same element has another value specified within the same code block, without another !important declaration. This should result in the second value being overridden by the first, but IE6 and lower do not honor this.

/* Make text blue in IE6 and lower */ body { color: black !important; color: blue; }

This hack uses valid CSS.

Read more about this topic:  CSS Filter

Famous quotes containing the word quirks:

    He hath achieved a maid
    That paragons description and wild fame;
    One that excels the quirks of blazoning pens.
    William Shakespeare (1564–1616)