Home > Web Front-end > HTML Tutorial > 底层绝对位置的div为什么把顶层div遮挡了?_html/css_WEB-ITnose

底层绝对位置的div为什么把顶层div遮挡了?_html/css_WEB-ITnose

WBOY
Release: 2016-06-21 09:13:08
Original
1260 people have browsed it

<div align="center" style="width:100%;position:absolute;background-color:#660;z-index:1;"><br /><br />z-index:1</div><div align="center" style="background-color:#066;z-index:2;">z-index:2</div><div align="center" style="background-color:#606;z-index:0;">z-index:0</div>
Copy after login

如上代码,z-index:1为什么把z-index:2也遮挡住了?
不改变彼此先后顺序的情况下,怎样让这个z-index:1且position:absolute的div只遮挡z-index:0不遮挡z-index:2


回复讨论(解决方案)



z-index:1;">

z-index:1

z-index:2

z-index:0

z-index:1;">

z-index:1

z-index:2

z-index:0
多谢!
source:php.cn
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template