Re: [css3-cascade] Proposed property: rule( sSelector );

This is a second attempt at explaining what @rule ought to mean, with regards to
the cascade.

bzbarsky@mit.edu [bzbarsky@mit.edu] wrote:
> Let us say I have the following UA rules:
> 
> div { display: block }
> p { display: block }
> 
> And the following user rules:
> 
> div { color: red !important }
> div.section { color: green }
> div.section { display: inline !important}
> p.section { color: purple }
> p { border: 1px solid red }
> p.section { white-space: pre !important }
> 
> And the following author rules:
> 
> p.section { color: white }
> p { display: inline }
> p.section { rule("div.section"); }
> 
> I have a <p class="section"> element. What rules apply to it? What is the
> cascade order for those rules?

Each property's values for this p.section are sorted by ascending importance -
winner at the top.

color:
red   - user div !important
white
green - author div.section - this loses to white as it is part of the @rule
purple
green - user div.section

white-space:
pre

border:
1px solid red

display:
inline - user div.section !important
inline - author p
block - UA p
block - UA div

-Chris "SoopahMan" Moschini
http://hiveminds.info/
http://soopahman.com/

Received on Wednesday, 22 October 2003 12:01:19 UTC