At 11:25 AM 2/2/2006, Zoe M. Gillenwater wrote:
>Brian Ogden wrote:
> > Is there a way to do this:
> >
> > <div style="text-align:center">Some Content
> > <div id="this one must be nested in the one above"
> > style="text-align:none"></div>
> > </div>
> >
> > In other words how do I stop the cascade?
>
>You can't stop the cascade. But every property has a default value, and
>you can set a property back to its default value in the second div. In
>your case, use "text-align: left;".
Just to be clear, you can reset the property to the value of your
choosing. If you know the default value, you can pick that one and
explicitly reset the property. What you can't do, though, is reset
the property to whatever it would have been otherwise. For example,
suppose you have the following:
<body>
<div style="color: red">
<p>some text</p>
</div>
</body>
The paragraph will inherit the red text color, so the words "some
text" will ordinarily be red. You can explicitly reset this to some
other value. However, there is no way in pure CSS to tell the
paragraph text to be the same color as the body text, unless you
explicitly know the color value of the body text. (In most UAs it
will default to black.) There is no way to "uninherit" or "zero out"
a property value. Once a property has a value, you need to
explicitly override that value.
I don't know if that makes a difference to you or not, but I wanted
to note it since there are times when this can be an issue
(especially when doing a redesign).
HTH,
-Adam Kuehn
______________________________________________________________________
css-discuss [EMAIL PROTECTED]
http://www.css-discuss.org/mailman/listinfo/css-d
IE7b2 testing hub -- http://css-discuss.incutio.com/?page=IE7
List wiki/FAQ -- http://css-discuss.incutio.com/
Supported by evolt.org -- http://www.evolt.org/help_support_evolt/