user2091061 user2091061 - 1 month ago 6
CSS Question

Make an item in list align to right using CSS3

I have a list as follows :

<ul id="menu">
<li><a href="#">Home</a></li>
<li><a href="#">Work</a>
<ul>
<li><a href="#">CSS Development</a></li>
<li><a href="#">Graphic Design</a></li>
<li><a href="#">Development Tools</a></li>
<li><a href="#">Web Design</a></li>
</ul>
</li>
<li><a href="#">About</a></li>
<li><a href="#">Contact Us</a></li>
<li><a href="#">Feedback</a></li>
</ul>


I am attaching image of so far what i have done..

In this menu,I want to align feedback to right side.
Can anyone tell how to do it?

PSL PSL
Answer

Add this to your Css.

li:last-child will select the last li of the menu list.

Demo

#menu > li:last-child
{
    float:right;
}
Comments