2013-02-16 68 views
2

我想通过多个背景创建边框并发现了一个问题。我需要将优先级应用于每个背景,因为它们中的许多重叠。CSS:多个背景的Z索引

是否有任何css属性来设置z-index每个背景?

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) 

那样。

喜欢的东西:

background-z-index:2,1,2 .. etc. 

回答

2

没有z-index的,但有一个堆叠顺序。这有点反直观,但是您指定的第一个图像将位于堆叠顺序(与HTML元素相反)的顶部(并且后面的图像将位于该图像的下方)。这里更多的信息:

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

+0

这不会帮助我。我猜我必须这样做,旧的方式... – Somebody 2013-02-17 10:15:28

0

有背景图像的无的z-index。 z-index仅适用于单个元素,而不适用于这些元素的属性。