问题是#one
与#three
重叠。为什么z-index
无效?
#one {
position: relative;
top: 35px;
z-index: 2;
}
<div id="one">one</div>
<div>two</div>
<div id="three">three</div>
答案 0 :(得分:-1)
<html>
<head>
<title>Page Title</title>
<style>#one{position:relative; top:35px; z-index: 1;background:white}
#three{
z-index:-3; background:white}
</style>
</head>
<body>
<div id="one">one</div>
<div>two</div>
<div id="three">three</div>
</body>
</html>