CSS 2: priorities in cascading order

Jason White writes:

 > Following recent discussion on the WAI IG list and elsewhere, I spent a
 > few minutes this afternoon re-reading the section of the CSS 2 draft that


 > I think there is definitely a problem that
 > needs to be considered by this working group, resulting from the fact that
 > where two or more inconsistent declarations are made, each of them having
 > the same specificity, the author-supplied declaration overrides the
 > reader's default style sheet.

That's correct. This is a controversial issue, but as explaned below,
I don't think it's much of a problem in practice. 

 > It has been pointed out to me that some authors
 > may tend to mark all of their colour and font declarations as important,
 > thereby defeating the reader's preferences.

I have never seen an author style sheet with !important in it. I have,
however, talked to many authors who are hesitant to start using style
sheets if it gives them less "control" than their current tools (i.e.

 > A second problem results from the definition of specificity. It was
 > mentioned some time ago on the interest group list that it is difficult to
 > design, for example, a "large font" style sheet, because more specific
 > declarations override those which are of greater generality.

This, I believe, is a real issue and you're among the few who have
spotted it. Today, writing a "large font" style sheet requires that
the other style sheets are written with cascading in mind, e.g. that
all font sizes are specified relative to the font size of the BODY
element. Changing the font size of the BODY element would then
propagate magnifications throughout the document.

To ease this problem, inheritance must be strengthend on the expense
of cascading. One proposal is to add the keyword "inherit" on all
properties, e.g.:

  BODY { font-size: 12pt }
  P { font-size: inherit }
  H1 { font-size: 140% }

This proposal has not yet been discussed in the CSS WG, but I think it

If we want to address the first issue, I believe we should do so
without adding any new syntax (a la adding "absolute" in addition to
"imporatant") since this would not work in older browsers. Instead, I
think CSS2 could say that "important" declararations in author style
sheets should be regarded as having normal weight.



H      k   o   n      W   i   u   m       L   i   e
howcome@w3.org      http://www.w3.org/people/howcome
World     W      i     d     e       Web  Consortium

Received on Wednesday, 17 December 1997 14:09:32 UTC