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

Re: "Inheriting" from a less-specific selector

From: Braden N. McDaniel <braden@shadow.net>
Date: Mon, 6 Sep 1999 00:57:43 -0400
Message-ID: <02cf01bef835$23011060$1e3a11cf@bonezero>
To: "L. David Baron" <dbaron@fas.harvard.edu>, <www-style@w3.org>
----- Original Message -----
From: L. David Baron <dbaron@fas.harvard.edu>
To: <braden@endoframe.com>; <www-style@w3.org>
Sent: Thursday, September 02, 1999 8:52 AM
Subject: Re: "Inheriting" from a less-specific selector


> On Thu, 26 Aug 1999 04:15:33 -0400 (EDT), "Braden N. McDaniel"
> (braden@endoframe.com) wrote:
> > But CSS2 has almost exactly the same problem elsewhere!
> >
> > 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. But as with
the
> > "inherit" problem in CSS1, there appears to be no way to recapture this
> > behavior once it has been overridden in the cascade.
>
> I'm a little puzzled by this statement.  If the following is in a user
> stylesheet:
>
> :link:hover { background: yellow; }
>
> it will (in a browser that supports CSS2) be overridden by the
> following statement in an author stylesheet:
>
> :link { background: transparent; }
>
> or even by
>
> * { background: transparent; }
>
> Pseudo-classes are just another part of a selector, and weight and
> origin are more important in the cascade than specificity.

Okay, I need to adjust my thinking. Even though I've known otherwise, I have
been intuitively thinking the opposite of this. I'll blame my warpage on IE,
which apparently ignores this.

> Pseudo-elements are a bit more like what you are describing, though.
> However, if you want to reset certain properties to their original
> state (assuming there aren't any important declarations in a user
> stylesheet), you can always do:
>
> *, *:before, *:after, *:first-letter, *:first-line {
>   /* everything else you would have put here... */
>   content: "";
>   }

Yep... I tried something like this initially, and when it didn't entirely
work, I decided there must be the problem I described. I'm embarrassed (yet
relieved) to say that the real problem seems to be with IE's cascade, and
the "inheritance from a less-specfic selector" was basically a wild goose
chase.

Sorry, folks. Thanks to you and Ian for setting me straight (again :).

--
Braden N. McDaniel
braden@endoframe.com
<URL:http://www.endoframe.com>
Received on Monday, 6 September 1999 03:02:00 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Monday, 27 April 2009 13:54:00 GMT