Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to change the z-index of the display:inline-block element?

Tags:

css

I'm trying to mimic the coverflow UI here: jsFiddle

As you can see on the right, the last image is covering the second last image. How do i circumvent this problem, or is there a better method other than display:inline-block. I'm trying to avoid using position:absolute as this involve calculating the position for every single image.

like image 811
p0larBoy Avatar asked Jul 20 '11 09:07

p0larBoy


1 Answers

See: http://jsfiddle.net/qqWMb/1/

li:nth-last-child(2) {
    position: relative;
    z-index: 1
}

http://reference.sitepoint.com/css/pseudoclass-nthlastchild

like image 158
thirtydot Avatar answered Oct 11 '22 21:10

thirtydot