css - z-index 问题

标签 css z-index

问题是 #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/

相关文章:

HTML - 为什么 z-index 不起作用?

html - 注入(inject) SquareSpace Header 的 NavBar Dropdown 在悬停时消失

html - 在移动设备上浏览我的页面时出现 Z-index 问题

javascript - 默认情况下显示选中的复选框

html - CSS float 按钮跳出wrapper分割

jquery - MediaWiki Javascript 轮播

css - 如何使 div 内的链接填充 div 内的整个空间?

css - IE定位div布局问题

css - 透明 Div 后面的可点击图像映射 - 在 IE 中工作