javascript - 如何创建简单的 div 和网站其余部分透明?

标签 javascript jquery

如何创建具有透明网站其余部分的简单 div(此 div 将在单击链接或其他 div 后显示)

这里的例子:

enter image description here

最佳答案

不能使用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/

相关文章:

javascript - 重复调用命中 php 文件的函数

javascript - Ruby Watir 或 JavaScript : Get 5 first elements of a section

javascript - 避免子组件中的未定义值

jquery - 使用 fancybox 和 css 悬停效果 - 冲突

javascript - 滑出菜单不滑出

javascript - 如何使用 jquery 从类中获取 css 属性

javascript - 当我更改语言时, Angular 翻译不会刷新 Controller 中的翻译

jquery - 使用 jquery 在菜单中突出显示当前 url

jquery - 在 jquery 中设置具有部分名称的所有字段的值

javascript - 缩略图在 Nivo slider 中相互堆叠