<div id="main">
<div id="sub">
</div>
</div>
Can I set main's style from sub's style?
<div id="main">
<div id="sub">
</div>
</div>
Can I set main's style from sub's style?
Cascading Stylesheets only go (cascade) down, so they're not designed to do this at all...even in those rare cases it would be very handy if they did.
You need either JavaScript, in-line style or a different layout to get the stying you're after...but pure CSS affecting the parent isn't an option here unfortunately.