我正在尝试创建一个网站,其中我有几个 div 使用z-index
和放置在背景 div 的前面position:absolute
。此背景 div 稍后将转换为内容轮播,因此其文本是可选择的至关重要。我当前的代码不允许选择文本和链接,我想知道如何解决这个问题。
HTML:
<div id="header" class="box">header</div>
<div id="bg">
Cannot highlight this text <br>
<a href="">Cannot click on this link</a>
</div>
<div class="box">content</div>
CSS:
.box { width: 150px; height:50px; background:aqua; margin:20px; }
#header { margin-bottom: 150px; }
#bg { width:200px; height:200px; padding-top:100px; background:pink;
position:absolute; top:0; z-index:-10;}
编辑- 我想要实现的图像:http: //imgur.com/r9tYx