Home › Forums › CSS › How to change the last menu item coding in a list? › Reply To: How to change the last menu item coding in a list?
August 31, 2013 at 12:33 pm
#148664
Participant
You can target the last item easily by using:
ul.MenuBarHorizontal li:last-child {
border-right:0;
}
However, you might want to give all the listitems a LEFT border (instead of right) and then target the FIRST item (li:first-child
) to have no border. This is because older versions of Internet Explorer do understand first-child
but not last-child
.