[BNM] IE7...meh.

Andy Smith andy.bnm at zambezi.org.uk
Wed Nov 5 13:10:07 GMT 2008


2008/11/4 David Andrew <david.andrew at gmail.com>:
> Additionally, IE6 ignores !important.

A minor nit, which doesn't make your explanation wrong, but which
might help in case anyone's confused about other uses of !important:

IE6 doesn't exactly ignore !important. When a single CSS rule contains
two or more declarations for the same property (as for width here),
IE6 (and earlier) uses the last declaration, regardless of whether
it's marked !important. It should (at least under one reading of the
CSS spec) use the last !important declaration, or the last normal
declaration if there are no !important declarations. But if you have
declarations in different rules, IE6 will recognise !important and
give those declarations precedence.

So with the rule below IE6 will use blue and standards-compliant browsers red:

    .one-rule {
      color: red ! important;
      color: blue;
    }

But with the two rules below, IE6 will correctly use red:

    .two-rules {
      color: red ! important;
    }

    .two-rules {
      color: blue;
    }

Andy


More information about the BNMlist mailing list. Powered by Wessex Networks