PDA

View Full Version : two different lists - CSS


IRN101
02/27/2007, 19:00
ok... no sleep.

I am working on a design that uses 2 UL lists. 1 is general and needs to cover all of the lists on the site. I am using

ul {} and li {}

BUT, I have one list that needs to be different and I've been trying to use

#navcontainer ul {} and #navcontainer li {}

It isn't working... What am I doing wrong?? I need a nap.

contrid
02/27/2007, 23:58
To add styles to list elements, you can do something like this (or post a project for it :) ) :


<ul id="myList">
<li></li>
<li></li>
</ul>


...and the stylesheet :


ul#myList
{
...
}
ul#myList li
{
...
}


Try that. It should work without problems.
Please post back and let us know. ;)

contrid
02/28/2007, 00:00
Off course...if you're not using an ID attribute for the UL, then your stylesheet will look a bit different if you're using CLASS.

It will look something like this :


ul .myList
{
...
}
ul .myList li
{
...
}


Good luck! And let us know. ;)

digitalnature
02/28/2007, 08:06
put a id or class to the ul/li elements, not their container div

IRN101
02/28/2007, 16:02
After getting some sleep I saw what I was doing wrong... I was just too tired to think straight. Thanks guys. :)

contrid
02/28/2007, 16:33
After getting some sleep I saw what I was doing wrong... I was just too tired to think straight. Thanks guys. :)

Good. Glad to hear that you got it working.