css z-index属性

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了css z-index属性相关的知识,希望对你有一定的参考价值。

/*
The z-index property specifies the stack order of an element.
An element with greater stack order is always in front of an element with a lower stack order.
z-index only works on positioned elements (position:absolute, position:relative, or position:fixed)

The “z-index” property can only be applied to elements which are positioned,
so in order to apply it to an element, the element needs to have “position” property set to a
different value than “static”

*/

div {
  position: relative;
  z-index: 1;  
}

以上是关于css z-index属性的主要内容,如果未能解决你的问题,请参考以下文章

设置z-index属性无效的css定位属性设置是

css属性z-index解析

css属性z-index解析

css属性z-index解析

CSS3 过渡 - 如何延迟 z-index 属性的重置?

css_浮层禁止击穿(防止可点击浮层下面的元素)