PDA

View Full Version : display:inline;



psilos
04-03-2007, 11:15 AM
Okie i want to make a menu with nested unordered lists.

the top-level menu should be horizontal so i add a CSS rule

#menu ul li {
display:inline;
}

the problem is that after that and the second-level would appear horizontal, instead of vertical that i want, and have the same properties with the first level..

How can i bring back the normal list behaviour?

Thanx..

Twey
04-03-2007, 11:19 AM
What you really want here is the child selector, #menu>ul>li. Unfortunately, IE6 doesn't support this little gem, so you'll have to override it:
#menu ul li {
display: inline;
}

#menu ul ul li {
display: list-item;
}