问题是 #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>
最佳答案
<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>
关于css - z-index 问题,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/50616810/