Hello,
There is something I do not understand with CSS applied to the <ul> tag. The rule:
#somediv ul ul {something}
seems to apply similarly to all nested <ul> in a structure such as:
<ul>
<li></li>
<li>
<ul>
<li></li>
<li>
<ul>
<li></li>
<li>
</ul>
</ul>
</ul>
This rule also applies to the 3rd <ul> whereas I would have thought I would also need this rule for the 3rd <ul>:
#somediv ul ul ul {something}
It is the same thing for this rule:
#somediv li {something}
seems to apply to all nested <li>...
Is there an explanation for this?
Thank you for your help
Cheers
Chris
Question about <ul>
Hi maflu,
It's because those are desendant selectors and effects all instances of the selector occuring within the topmost selector i.e #somediv li {font-size;12px;} effects all li within the #somediv. To just effect the first instance you would need to use the 'child' selector '>' then only the selector that is a direct offspring of it's parent is effected, but be carefull as IE has very poor support for contextual selectors and doesn't support the child selector at all.
hope that helps,
Hugo.
Question about <ul>
Yes it helps. Thank you. I understand now.
Cheers
