Previous Message
Next Message

styling ul

Sent by John Dickinson on 30 August 2004 18:06


I'm using an unordered list (styled to be inline) for a menu and I would like to push the last list
item to the right. If is use a float:right on the last item it goes to the right, but it also ends
up one line lower than the rest of the menu. Setting the margin to auto doesn't do anything. I can
hard code some specific amount for the last li to move over, but because the number of list items is
generated dynamically, I will never know the exact amount to move it over. Any ideas?

--John

My XHTML is similar to the following:

<div id="menu">
<ul>
<li>one</li>
<li>two</li>
</ul>
</div>

....with the following css:

#menu ul { padding: 0; display: inline; }
#menu li { display: inline; margin-right: 10px; }
#menu li:last-child {
	margin-right: 0;
	/* what should go here? */
}
______________________________________________________________________
css-discuss [EMAIL-REMOVED]]
http://www.css-discuss.org/mailman/listinfo/css-d
List wiki/FAQ -- http://css-discuss.incutio.com/
Supported by evolt.org -- http://www.evolt.org/help_support_evolt/
Previous Message
Next Message

Message thread: