如何创建具有透明网站其余部分的简单 div(此 div 将在单击链接或其他 div 后显示)
这里的例子:
最佳答案
不能使用rgba(0, 0, 0, 0.8);
作为背景吗? Fiddle For Demonstration
div#transparent {
width:100%;
height:100%;
position:absolute;
top:0;
left:0;
z-index:2;
background:rgba(0, 0, 0, 0.8);
}
div#content {
width:300px;
height:300px;
position:absolute;
top:0;
left:0;
right:0;
bottom:0;
margin:auto;
}
关于javascript - 如何创建简单的 div 和网站其余部分透明?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/14919599/