Jump to content

class not showing


spiderwell

Recommended Posts

i have a UL within a DIV that has an ID, i then use that to set up styling for the list and its elements.

.red {color:#ff0000;	font-weight:bold;} 

#sectionlist { list-style: none; width:800px;margin-left:0; }  
#sectionlist ul{ list-style: none; margin:0px; padding:0px;} 
#sectionlist li { position: relative; margin: 2 0 0 0;  width: 800px;-moz-border-radius: 5px; -webkit-border-radius: 5px; font-size:14px; border:#000000;text-decoration: none;
padding:  1px;
margin-right: 3px;
border: 1px solid #778;
color: #2d2b2b;
background-color: #ddddff;
height:22px;
margin-top:2px;
text-align:left;
font-size:12px;
}

 

 

now i want to make one of the <li> elements have red text, i add a class called red so it looks like this <li class="red">

 

but it never shows up red, i have to end up adding a span or div inside the <li> to get the class of red to work.

 

is this normal behaviour or am I missing something?

Link to comment
Share on other sites

sunfighter, your idea would be fine if it was all <li> to have red font, but I only want 1 of them too. I guess I hadn't made it clear enough.

I am sorry i got that wrong, it worked perfectly.

 

I thought I could just have one class to cover all red text in various different lists, but i guess i need the red class defined inside each id specified too. good to learn though, i am so guilty of not learning css properly as this thread proved

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.