Sent by Jukka K. Korpela on 20 August 2003 13:01
On Wed, 20 Aug 2003, Ken Chase wrote:
> > I was just wondering if there was a way of choosing not to style an
> > element?
>
> FYI
> CSS2 Specification - Chapter 5 Selectors
> <http://www.w3.org/TR/REC-CSS2/selector.html>
Yes, using suitable selectors we can often restrict the effect of a CSS
rule to the desired element, and in that sense exclude other elements.
> This might be interesting to you although many of the selectors do not
> work in IE. I've only tried them in Moz 1.5a
That's true, too. The contextual selectors work well, and so do class
selectors, but advanced selectors like attribute selectors don't.
This means that quite often we need add markup (like class attributes)
even in cases where we could dispense with them if all CSS selectors
worked.
But the original question could also be read as asking whether it is
possible to specify that some element no be styled _even though_ there is
a _preceding_ (or following) declaration that applies to it. The answer is
unfortunately "no". Once you've said, say, color: red in a way that
applies to some elements, there's no way to say that for some of those
elements, the browser's default color be used instead. (You can set color
to any specific color, but that's a different thing. And the special
value inherit is yet another thing.)
--
Jukka "Yucca" Korpela, http://www.cs.tut.fi/~jkorpela/
______________________________________________________________________
css-discuss [EMAIL-REMOVED]]
http://www.css-discuss.org/mailman/listinfo/css-d
Supported by evolt.org -- http://www.evolt.org/help_support_evolt/