> -----Original Message-----
> From: css-d-boun...@lists.css-discuss.org [mailto:css-d-
> boun...@lists.css-discuss.org] On Behalf Of Gates, Jeff
> Sent: Thursday, April 28, 2011 11:19 AM
> To: Chetan Crasta
> Cc: css-d@lists.css-discuss.org
> Subject: Re: [css-d] Styling Submenus on a Dropdown Menu
> 
> On 4/28/11 11:02 AM, "Chetan Crasta" <chetancra...@gmail.com>
> wrote:
> 
> To apply styles only to the first level <li>s, use this selector:
> 
> #primary-nav .tab_navigation > ul > li
> 
> 
> I'm sorry, Chetan, but I'm not getting it. Is "#primary-nav
> .tab_navigation > ul > li" the actual way you are suggesting writing
the
> id? And, if so, which of the styles are you suggesting I apply it
to?
> 
> I tried substituting that selector verbatum for all styles of the id
> #primary-nav. That didn't work. Then I tried it with just the li and
with
> just the li and ul styles. That didn't work. Then I got rid of the
">"
> (thinking you meant apply "#primary-nav .tab_navigation" to just the
> styles for the ul and the li. That didn't work. So I'm stymied.
Could you
> explain what you mean in a bit more detail. Thanks.
> 

#primary-nav.tab_navigation selects the id.
#primary-nav.tab_navigation ul selects all the uls in the id.

<div id="primary-nav" class="tab_navigation">
        <ul id="list1"> <li> <ul id="list2"> <li></li></ul></li></ul>
        <ul id="list3"><li></li></ul>
</div>

so it selects #list1, #list2, and #list3.

#primary-nav.tab_navigation > ul selects only top level uls in the id
(#list1, and #list3, but not #list2).

So #primary-nav.tab_navigation > ul > li would select the list items
that are in #list1 and are not in #list2.

---Tim

______________________________________________________________________
css-discuss [css-d@lists.css-discuss.org]
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