Click to See Complete Forum and Search --> : <li> class?
Daniel T
03-28-2004, 06:27 PM
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,
-Dan
Nedals
03-28-2004, 06:53 PM
Worked for me in both Mozilla and IE6 with and without the <ul> tag.
ie: list of white text on a red, bordered background.
Daniel T
03-28-2004, 06:54 PM
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.
-Dan
David Harrison
03-28-2004, 06:54 PM
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?
Daniel T
03-28-2004, 06:58 PM
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 (http://216.36.173.149/). 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 while
I don't see a menuHeader class in your CSS anywhere...
Daniel T
03-28-2004, 07:06 PM
Originally posted by pyro
I don't see a menuHeader class in your CSS anywhere...
From http://216.36.173.149/styles.css
<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 (http://216.36.173.149/ocrap.php).
-Dan
You must not have uploaded the latest styles.css, as it still is not there. .menuTitle is, though...
Daniel T
03-28-2004, 07:15 PM
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!
-Dan
Paul Jr
03-28-2004, 07:20 PM
The 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.
Daniel T
03-28-2004, 08:15 PM
OK! THANX (again) RYAN!
-Dan
**EDIT**
NOT WORKING:(
There's no space in li.menuheader
Daniel T
03-28-2004, 08:33 PM
Yeah 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:
-Dan
There is not supposed to be a space there. Sorry about my wording above - I just reread it and it's very confusing.
Daniel T
03-28-2004, 08:37 PM
Oh, OK! Now it's workin! Thanx Ryan!
-Dan