Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

HTML Forum


You are currently viewing our HTML Forum as a guest. Please register to participate.
Login



Post a Project »

Find a Professional HTML Freelancer!

Find a Freelancer to help you with your HTML projects

FREE Outsourcing eBook!

Reply
Multiple <li> styles in one <ul>?
Old 06-10-2009, 12:41 PM Multiple <li> styles in one <ul>?
Junior Talker

Posts: 3
Name: susan
Trades: 0
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!
__________________

Please login or register to view this content. Registration is FREE
I
Please login or register to view this content. Registration is FREE
susanjohnyba is offline
Reply With Quote
View Public Profile
 
 
Register now for full access!
Old 06-10-2009, 02:33 PM Re: Multiple <li> styles in one <ul>?
LadynRed's Avatar
Defies a Status

Posts: 10,017
Location: Tennessee
Trades: 0
Well, for one thing your UL's aren't nested properly, they should be like this:
Code:
<ul>
<li>category
     <ul>
     <li>sub-category</li>
     </ul>
</li> /end of first category>
Then you could target the sub category using something like : ul ul{rules}.
__________________
Web Goddess & Web Standards Evangelist :) - Tables Be Gone !!

Please login or register to view this content. Registration is FREE


Please login or register to view this content. Registration is FREE

LadynRed is offline
Reply With Quote
View Public Profile
 
Old 06-10-2009, 04:47 PM Re: Multiple <li> styles in one <ul>?
World's Avatar
Extreme Talker

Posts: 202
Location: Santa Monica, CA
Trades: 0
Couldn't she just do an ul, and apply different classes to different categories of list items?

Then she could style them individually without becoming a bird from all that nesting.
World is offline
Reply With Quote
View Public Profile
 
Old 06-10-2009, 08:08 PM Re: Multiple <li> styles in one <ul>?
LadynRed's Avatar
Defies a Status

Posts: 10,017
Location: Tennessee
Trades: 0
If she wanted each one to be different, then yes, but that seems like an awful lot of extra work. It still doesn't change the fact that her nesting is incorrect.
__________________
Web Goddess & Web Standards Evangelist :) - Tables Be Gone !!

Please login or register to view this content. Registration is FREE


Please login or register to view this content. Registration is FREE

LadynRed is offline
Reply With Quote
View Public Profile
 
Reply     « Reply to Multiple <li> styles in one <ul>?
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

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





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.18031 seconds with 12 queries