Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

CSS: Z-index of multiple backgrounds

Tags:

css

I want to create border via multiple backgrounds and have spotted one problem. I need to apply priorities to each background, because many of them overlap each other.

Is there any css property to set z-index each background?

left-top-corner(z-index:2) top(repeat-x) right-top-corner(z-index:2)
left(repeat-y)
left-bottom-corner(z-index:2) bottom(repeat-x) right-bottom-corner(z-index:2)

like that.

Something like:

background-z-index:2,1,2 .. etc.
like image 280
Somebody Avatar asked Feb 16 '13 21:02

Somebody


1 Answers

No z-index, but there is a stacking order. It's kinda counter intuitive, but the first image you specify will be on top (and subsequent images will be below that) in the stacking order (opposite of HTML elements). More info here:

http://css-tricks.com/stacking-order-of-multiple-backgrounds/

like image 66
steveax Avatar answered Oct 21 '22 13:10

steveax