Go Back   WarriorForum - Internet Marketing Forums > Warrior Support Forums > Website Design
Register Blogs FAQ Social Groups CalendarHelp Desk

Reply
 
LinkBack Thread Tools
Old 06-10-2009, 09:54 AM   #1
Warrior Member
 
Join Date: Jun 2009
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default Multiple <li> styles in one <ul>?

Hello,

I have been stumped working on this issue for about 2 days now, but havent been able to jump this hurdle:

transeca.com

My navigation is dynamically created in a loop:

<ul id="glossymenu">
<li>Category</li>
<li>sub category</li>
<li>sub category</li>
<li>Category</li>
<li>sub category</li>
</ul>

If you visit the page, the first <li> is 'Pet GPS' , this is a top level category. The next top level category is all the way at the bottom called 'Test'.

Basically Im trying to assign 2 different styles a 'Category' and 'sub category', my attempt at this is using an id on only the top level <li>'s:

<ul id="glossymenu">
<li id="maincat">Category</li>
<li>sub category</li>
<li>sub category</li>
<li id="maincat">Category</li>
<li>sub category</li>
</ul>

But I dont seem to be able to override the style in this manor:

#maincat li a{
background:#000000;
}

My stylesheet:
transeca.com/css/style.css

Any advice is deeply appreciated!

susanjohnyba is offline   Reply With Quote
Old 06-10-2009, 10:34 AM   #2
Advanced Warrior
War Room Member
 
promo_guy's Avatar
 
Join Date: Jul 2008
Location: UK by way of Cali
Posts: 786
Thanks: 443
Thanked 209 Times in 101 Posts
Default Re: Multiple <li> styles in one <ul>?

I assume you got this working Susan? It seems both category and subcats have different bg colors
promo_guy is offline   Reply With Quote
Old 06-10-2009, 10:42 AM   #3
Designer Warrior
War Room Member
 
rawservices's Avatar
 
Join Date: Jun 2009
Location: San Diego
Posts: 224
Thanks: 57
Thanked 14 Times in 11 Posts
Social Networking View Member's Twitter Profile 
Contact Info
Send a message via AIM to rawservices Send a message via Skype™ to rawservices
Default Re: Multiple <li> styles in one <ul>?

Hey susan,


you need to apply a class to the sub nave and I would suggests wrapping your list in a div, example:

<div id="navigation">

<ul>
<li>Parent Nav </li>
<li class="subnav"> Sub Nav </li>
</ul>

</div>


then you would CSS like this basically:

#navigation ul {

Style it here

}

#Navigation ul li {

Style a lil more if you want

}

.Subnav {

Sub nav Style here

}




Hope this helps!

-Ryan

rawservices is offline   Reply With Quote
Reply

  WarriorForum - Internet Marketing Forums > Warrior Support Forums > Website Design

Tags
<li>, <ul>, multiple, styles

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off



All times are GMT -6. The time now is 02:09 AM.