当前位置: 首页 > 网络学院 > 网页制作基础教程 > CSS > CSS z-index属性
The z-index property sets the stack order of an element. An element with greater stack order is always in front of another element with lower stack order.
z-index属性可以设置元素的堆放次序。有着较大的值的元素会堆叠在较小值元素的上面。
Note: Elements can have negative stack orders.
注意:元素可以使用负数的堆叠次序
Note: Z-index only works on elements that have been positioned (eg position:absolute;)!
注意:Z-index只可以在被定位的元素上使用(比如 position:absolute)
Inherited: No
继承性:无
img |
值 | 描述 |
---|---|
auto | The stack order is equal to its parents 堆叠次序值等于它的父级堆叠次序值 |
number | Sets the stack order of the element 设置元素的堆叠次序值 |