Home  >  Article  >  Web Front-end  >  z-index属性值为负数的作用_html/css_WEB-ITnose

z-index属性值为负数的作用_html/css_WEB-ITnose

WBOY
WBOYOriginal
2016-06-24 11:41:102836browse

z-index属性值为负数的作用:

在很多CSS代码中,可以看到z-index属性值被设置为负数的情况,下面就简单介绍一下,此属性值为负数情况下的表现。在一般情况下只要对象设置了position属性,且属性值不为static,那么此对象能够覆盖非定位对象,代码实例如下:

蚂蚁部落

以上代码中a元素能够覆盖b元素,再看一段代码实例:

蚂蚁部落

以上代码可以看出b元素能够覆盖a元素,也就是说普通文档流中的元素能够覆盖设置了position属性,且属性值不为static,同时z-index值为负数的对象。

原文地址是:http://www.51texiao.cn/div_cssjiaocheng/2015/0503/583.html

最为原始地址是:http://www.softwhy.com/

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn