I have the folowing nested list structure:
HTML:
<div id="my_nested_list">
<ul>
<li>
Item label
<ul>
<li>Subitem 1</li>
<li>Subitem 2</li>
<li>Subitem 3</li>
</ul>
<li>
<li>...</li>
</ul>
</div>
CSS:
#my_nested_list>ul {
/* first level list */
}
#my_nested_list>ul>li {
/* first level items */
}
#my_nested_list>ul>li ul {
/* second level list */
}
#my_nested_list>ul>li ul>li {
/* second level items */
}
My problem is that with space selector instead of >, first level rules apply on the second level. But i need ie6 support, which does not support >. Thus i have to use space.
So far i have 2 solutions:
- put classes on every ul and li, and use
#my_nested_list ul.firstlevel li.firstlevel - use
#my_nested_list ul li, and#my_nested_list ul li ul lito rewrite every unwanted first level rule.
Do you have better ideas?
>, first level rules apply on the second level" And he says he doesn't want that..list liand.nestedlist liand just give theultags the appropriate class. Override in nestedlist what you inherit from list and want differently.