css 实现弹框
2013-11-21 21:25
218 查看
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<style style="text/css">
.black_overlay{
display: none;
position: absolute;
top: 0%;
left: 0%;
width: 100%;
height: 100%;
background-color: black;
z-index:1001;
-moz-opacity: 0.8; /*改变图片透明度,越小越透明,*/
opacity:.50;
filter: alpha(opacity=88);
}
.white_content {
display: none;
position: absolute;
top: 25%;
left: 25%;
width: 50%;
height:50%;
border: 5px solid #33498b;
background-color: white;
z-index:1002;
overflow: auto;
}
.checkboxset{margin:0 auto; width:60%;}
.checkb1{float:left; margin:22% 25px;}
.checkb2{ float:left;margin:22% 25px;}
.checkb3{float:left;margin:22% 25px;}
.checkb4{float:left;margin:22% 25px;}
</style>
<script type="text/javascript">
//弹窗设置
function clK(){
document.getElementById('light').style.display='block';
document.getElementById('fade').style.display='block';
}
function clickClose(){
document.getElementById('light').style.display='none';
document.getElementById('fade').style.display='none';
}
</script>
</head>
<body>
<div><h3 onclick="clK()">点击弹窗</h3></div>
<div id="light" class="white_content">
<input type="button" id="consoleBtn" value="取消" onclick="clickClose()" />
</div>
<div id="fade" class="black_overlay"></div>
</body>
</body>
</html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<style style="text/css">
.black_overlay{
display: none;
position: absolute;
top: 0%;
left: 0%;
width: 100%;
height: 100%;
background-color: black;
z-index:1001;
-moz-opacity: 0.8; /*改变图片透明度,越小越透明,*/
opacity:.50;
filter: alpha(opacity=88);
}
.white_content {
display: none;
position: absolute;
top: 25%;
left: 25%;
width: 50%;
height:50%;
border: 5px solid #33498b;
background-color: white;
z-index:1002;
overflow: auto;
}
.checkboxset{margin:0 auto; width:60%;}
.checkb1{float:left; margin:22% 25px;}
.checkb2{ float:left;margin:22% 25px;}
.checkb3{float:left;margin:22% 25px;}
.checkb4{float:left;margin:22% 25px;}
</style>
<script type="text/javascript">
//弹窗设置
function clK(){
document.getElementById('light').style.display='block';
document.getElementById('fade').style.display='block';
}
function clickClose(){
document.getElementById('light').style.display='none';
document.getElementById('fade').style.display='none';
}
</script>
</head>
<body>
<div><h3 onclick="clK()">点击弹窗</h3></div>
<div id="light" class="white_content">
<input type="button" id="consoleBtn" value="取消" onclick="clickClose()" />
</div>
<div id="fade" class="black_overlay"></div>
</body>
</body>
</html>
相关文章推荐
- CSS+JS实现遮罩层弹框
- HTML + CSS + JQuery实现弹框
- css三角形实现的几种方法的区别
- 根据HTML+CSS完成一个三列布局,左右侧栏宽为180px,高为300px;中间栏自适应,高为300px;中间栏子元素(宽高不确定)实现水平、垂直居中。
- ajax+servlet+css实现简单的页面刷新和显示控制
- css强制换行和超出隐藏实现
- css实现折叠面板
- 如何让CSS实现多游览器兼容
- 用CSS实现表格背景颜色渐变效果
- 利用div+css实现几种经典布局的详解,样式以及代码!
- CSS实现HTML元素透明的那些事
- 用 js、html、css实现一个弹出提示控件:
- 纯css实现垂直水平居中
- js+css+ul实现二级菜单
- 使用js操作css实现js改变背景图片
- 用原生Javascript实现css的placeholder
- Div+Css实现段落首行缩进两个字符(text-indent标签)
- 一步步教你实现纯CSS的柱形图
- CSS实现边框布局(百度前端笔试)
- 用CSS实现3D魔方动画旋转