<li> class?

liunx

Guest
Ok, on my site, I have to use the following on a list-item in an unordered list(this way works):
<li style="padding-left:5px; border:1px solid #000; border-left:0; border-bottom:0; width:145px; background-color:#c33; color:#fff;">
I tried putting this in a stylesheet:
.menuHeader {
padding-left:5px;
border:1px solid #000;
border-left:0;
border-bottom:0;
width:145px;
background-color:#c33;
color:#fff;
}
And this in the HTML:
<li class="menuHeader">
But, for some reason, it doesn't apply the class attributes, and treats it like a normal list-item. Any ideas? Thanx in advance,
-DanWorked for me in both Mozilla and IE6 with and without the <ul> tag.
ie: list of white text on a red, bordered background.Originally posted by Nedals
Worked for me in both Mozilla and IE6 with and without the <ul> tag.
ie: list of white text on a red, bordered background.
Thanx, but is it proper to leave out the <ul> tag? I want to keep my site valid.
-DanI made a little page with what you posted and I don't have any such difficulty. You got a page with this problem on?Originally posted by lavalamp
I made a little page with what you posted and I don't have any such difficulty. You got a page with this problem on?
Ok, I've modified the second heading on the menu of my website (<!-- m --><a class="postlink" href="http://216.36.173.149/">http://216.36.173.149/</a><!-- m -->). As you can see, it isn't applying the class atributes to the <li>.
-Dan

PS: Mite wanna look as soon as you can, because I'll be changing it back after a whileI don't see a menuHeader class in your CSS anywhere...Originally posted by pyro
I don't see a menuHeader class in your CSS anywhere...
From <!-- m --><a class="postlink" href="http://216.36.173.149/styles.css">http://216.36.173.149/styles.css</a><!-- m -->
<snip>
.menuheader {
padding-left:5px;
border:1px solid #000;
border-left:0;
border-bottom:0;
width:145px;
background-color:#c33;
color:#fff;
}
**EDIT**
Ok, I'm changing it back now, but you can find a copy of the faulty page here (<!-- m --><a class="postlink" href="http://216.36.173.149/ocrap.php">http://216.36.173.149/ocrap.php</a><!-- m -->).
-DanYou must not have uploaded the latest styles.css, as it still is not there. .menuTitle is, though...Originally posted by pyro
You must not have uploaded the latest styles.css, as it still is not there. .menuTitle is, though...
Have you refreshed? It's there for me!
-DanThe class isn't being applied in the Mark-Up.Ah, I see the problem (now that I can see the correct CSS).

.menuheader is not as specific of a rule as #nav ul li, so it is using the #nav ul li instead. It will use the more specific of the two rules. Change .menuheader to #nav ul li.menuheader and it should be fine.OK! THANX (again) RYAN!
-Dan

**EDIT**
NOT WORKING:(There's no space in li.menuheaderYeah there is! I had it with no space a while ago to see if it worked, but there's one there now, and it still doesn't work:confused:
-DanThere is not supposed to be a space there. Sorry about my wording above - I just reread it and it's very confusing.Oh, OK! Now it's workin! Thanx Ryan!
-DanSure thing. :)
 
Back
Top