W3C home > Mailing lists > Public > www-style@w3.org > December 2003

[CSS21] Remarks to '!important' rules

From: Jens Meiert <jens.meiert@erde3.com>
Date: Mon, 22 Dec 2003 11:16:58 +0100 (MET)
To: "W3C CSS" <www-style@w3.org>
Message-ID: <25425.1072088218@www66.gmx.net>

The '!important' rule example [1] doesn't seem to be chosen well, CMIIW: At
first, the assertion 'However, the third rule in the user's style sheet is
not "!important" and will therefore lose to the second rule in the author's
style sheet [...]' also applies to the third rule in the author's style sheet
(as defined by the cascading order [2]), though it might not result in the
value the UA will use.

Second, I think the given example generally ain't that elegant (in this
simple case) because it uses redundant declarations (related to the 'font-size'
property); why should an author define

    p { font: 12pt sans-serif !important }
    p { font-size: 24pt }

when he could simply use

    p { font: xpt sans-serif !important }

where x is either 12 or 24?

-- As another issue, is it intended to give examples using '!important' as
well as '! important' on the entire page [2]? I perceive this as
'inconsistent' since both expressions are frequently used there (without any noticeable
differentiation), and I claim there will be some people irritated by these
examples. It might be better to use only one form consequently.

Best regards,

[1] http://www.w3.org/TR/2003/WD-CSS21-20030915/cascade.html#important-rules
[2] http://www.w3.org/TR/2003/WD-CSS21-20030915/cascade.html#cascading-order
[2] http://www.w3.org/TR/2003/WD-CSS21-20030915/cascade.html

Jens Meiert
Interface Architect

Received on Monday, 22 December 2003 05:23:44 UTC

This archive was generated by hypermail 2.3.1 : Monday, 2 May 2016 14:27:10 UTC