Quote:
Originally Posted by djab
Hello!
I'm trying to make a new css row that will select the last item in my dropdown menu. This way i can add a rounded corner image that would look nice.
Heres what i have. But what do i need to make the name to be so it gets the last item?
Code:
/* Menu Dropdowns */
#rt-header li ul {background: #222;border: 1px solid #333;}
Thanks
Andrew
|
Hey Andrew
Not really sure what you are after but if you are trying to target the last element of anything you can use the :last-child psuedo class found in CSS2 (not compatible with ie8 and below). If you want it to be supported in IE it may be better using JS. I am not sure if that answers your question?!
There is a simpler way of applying an image to the last element of a list if you know how many items are going to be in that list. You could just apply a class to the final <li >.
All the best,
p.s the code above would work better this way round:
#rt-header ul li {background: #222;border: 1px solid #333;}
Last edited by Mug; 12-15-2010 at 09:47 PM..
|