我有两个全屏divs堆叠。使div可见,但能够点击通过
CSS
#border-overlay {
position:absolute;
z-index: 100;
top:0; left:0;
width: 100vw;
height: 100vh;
box-sizing: border-box;
border: solid 8px white;
}
#button
position: absolute;
display: block;
top: 0; left: 0;
height: 100%; width: 100%;
background-color: rgba(0,0,0,0);
z-index: 15;
}
HTML
<div id="border-overlay"></div>
<a id="button" href=""> ... </a>
我需要在顶部边框的div按钮DIV,然而由此,能够消除我想保持按钮的链接功能。本质上,按钮占据全屏幕,因此您可以在任何地方点击。
任何具体原因你想在上边框的div? – Kan412
也许这有助于:http://stackoverflow.com/questions/3680429/click-through-a-div-to-underlying-elements – daymosik
你的代码不清楚你需要什么,你能描述更多吗? – M98