Possible to reverse the layering of items in an unordered list using CSS?
I have a collection of items in an unordered list that overlap each other. My issue is that I need the first item to have the highest z-index and then go down from there. I can do this manually by setting the z-index:
http://jsfiddle.net/dp9YD/7/
But I would like to do this without manually setting each z-index (not sure if this is possible). Right now If i don't use the z-index it renders like this:
http://jsfiddle.net/dp9YD/8/
With items that come later in the list being on top which is what I would expect. Is there a way that I can get it to render like the first example without manually specifying the z-inde开发者_StackOverflow社区x or using javascript?
I have needed to do something similar in the past. I solved it be floating all li's to the right and listing them in reverse order.
See this fiddle: http://jsfiddle.net/sl1dr/KfK9w/
精彩评论