On Oct 12, 2008, at 11:25 AM, Erik Harris wrote:

> I've got a <ul> element buried with this hierarchy:
> ....div#sidebar > ul > li#pages > ul
>
> I've got the following two lines in my stylesheet:
>
> #sidebar ul ul {margin: 5px 0 0 10px;}
> #pages ul {margin: 0em; padding: 0em;}
>
> Despite the fact that it seems that the second line should be more
> specific (#pages is more specific because it's deeper in the  
> hierarchy),
> the first line is the one that's taking precedence.  I'm getting the  
> 5px
>  and 10px margins on my #pages ul, and FireBug confirms that the first
> line overriding the second one.  Can anyone explain why my line of
> thinking is incorrect, and why CSS is interpreting it this way?

#sidebar ul ul : a=1 b=0 c=2 --> 102
#pages ul a=1 b=0 c=1 --> 101

http://www.w3.org/TR/css3-selectors/#specificity

Philippe
---
Philippe Wittenbergh
http://l-c-n.com/





______________________________________________________________________
css-discuss [EMAIL PROTECTED]
http://www.css-discuss.org/mailman/listinfo/css-d
List wiki/FAQ -- http://css-discuss.incutio.com/
List policies -- http://css-discuss.org/policies.html
Supported by evolt.org -- http://www.evolt.org/help_support_evolt/

Reply via email to