W3C home > Mailing lists > Public > www-style@w3.org > August 1999

Re: "Inheriting" from a less-specific selector

From: Ian Hickson <py8ieh@bath.ac.uk>
Date: Sat, 28 Aug 1999 15:48:51 +0100 (BST)
To: "Braden N. McDaniel" <braden@endoframe.com>
cc: www-style@w3.org, Bert Bos <Bert.Bos@sophia.inria.fr>
Message-ID: <Pine.GSO.4.04.9908281532380.20013-100000@midge.bath.ac.uk>
On Thu, 26 Aug 1999, Braden N. McDaniel wrote:

> CSS1 has the problem that while inheritance was the effective initial
> value for many properties, there was no way for style sheet authors to
> specify it. So once it had been overridden, there was no way to
> reclaim the inheritance behavior lower in the cascade. CSS2,
> fortunately, fixed this.
> With the pseudo-classes ":active", ":hover", and ":focus", CSS2
> introduces the notion that, by "default", these pseudo-classes inherit
> their property values from the next-least-specific selector for an
> element.

CSS1 has this 'problem' too, and there is no need to invoke pseudo
classes to demonstrate it: this is the whole idea of the cascade.

For example:

   P EM { color: red } 
   STRONG EM { color: green }

   <P> <STRONG> <EM> green </EM> </STRONG> </P>

How can you make an EM in a STRONG be the same color as an EM _not_ in a
STRONG, without knowing what the colour of an EM not in a strong would
normally be? You can't. (You could override the later rule by using
!important, and you could change the order, but that is 'cheating'.)

> For the "cascade" concept to work where the state of the cascade is not
> known in advance, it is imperitive that style sheet authors always be
> able to restore the cascade to a defined state.

Not IMHO. So long as users and UAs write stylesheets that are self-
consistent and responsible (see David's piece, quoted earlier today), then
there is no need for authors to be totally in control of the cascade.

Ian Hickson
: Is your JavaScript ready for Nav5 and IE5?
: Get the latest JavaScript client sniffer at 
: http://developer.netscape.com/docs/examples/javascript/browser_type.html
Received on Saturday, 28 August 1999 10:48:55 UTC

This archive was generated by hypermail 2.3.1 : Monday, 2 May 2016 14:26:51 UTC