I have a basic unordered list that I want to style.
I want to add a style to all the lis except that last one.
If it’s any easier, I know the list will always have three items, and only have three items, so I want to apply a style to the first two items and not the third one.
The list is dynamically created so I can’t set an id or specific class for the third li.
The list is dynamically created so I can’t set an id or specific class for the third li.
Okay, since you can’t set ID or class your only option left with support for IE7+ is to use the “adjacent sibling selector”. It won’t work in IE6 but your the one that put these limitations on us.
IE8 and under do not support :last-child so that is why I don’t see it as an option.