【发布时间】:2014-11-25 23:18:28
【问题描述】:
我正在使用引导程序 3,我需要在面板内部创建用户无法点击链接的不透明度,这是我的工作小提琴
http://jsfiddle.net/52VtD/9230/
问题是不透明度总是全屏我只需要在面板主体中? 我需要只用 css 来做,这可能吗?
这是我目前的代码
<div class="panel panel-primary">
<div class="panel-heading">
<h3 class="panel-title">Panel title</h3>
</div>
<div class="panel-body">
<a href="#">I dont want allow user to clikc on this link</a>
</div>
</div>
CSS
.panel-body:before{
position: fixed;
z-index: 999;
width: 100%;
height: 100%;
text-align: center;
background: rgba(0,0,0,0.8);
}
更新
我找到了更好的解决方案
.panel-body{
opacity: .7;
pointer-events: none;
}
【问题讨论】:
-
请注意
pointer-events在 IE10 及以下版本中不受支持 - caniuse.com/#feat=pointer-events -
为什么你首先想要一个不可点击的链接?
-
我想要的不仅仅是链接,里面的所有东西都不能点击