CSS:多个背景的Z-index [英] CSS: Z-index of multiple backgrounds

查看:72
本文介绍了CSS:多个背景的Z-index的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想通过多个背景创建边框,但发现了一个问题.我需要对每个背景应用优先级,因为其中许多彼此重叠.

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.

是否有任何CSS属性可为每个背景设置z-index?

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)

那样.

类似的东西:

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

推荐答案

没有z-index,但是有堆叠顺序.这有点违反直觉,但您指定的第一个图像将按堆叠顺序位于顶部(与之相对应的是其后的图像)(与HTML元素相反).这里有更多信息:

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/

这篇关于CSS:多个背景的Z-index的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆