Html-Css-div透明层剧中
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>Div+CSS实现始终居中的半透明弹出层</title>
<style type="text/css">
<!--
html, body {
height: 100%;
margin: 0px;
font-size: 12px;
} .mydiv {
background-color: #FFCC66;
border: 1px solid #f00;
text-align: center;
line-height: 40px;
font-size: 12px;
font-weight: bold;
z-index: 999;
width: 300px;
height: 120px;
left: 50%;
top: 50%;
margin-left: -150px !important; /*FF IE7 该值为本身宽的一半 */
margin-top: -60px !important; /*FF IE7 该值为本身高的一半*/
margin-top: 0px;
position: fixed !important; /* FF IE7*/
position: absolute; /*IE6*/
_top: expression(eval(document.compatMode &&
document.compatMode == 'CSS1Compat')?
documentElement.scrollTop+ (document.documentElement.clientHeight-this.offsetHeight)/2:
/*IE6*/
document.body.scrollTop+ (document.body.clientHeight- this.clientHeight)/2);
/*IE5 IE5.5*/
} .bg, .popIframe {
background-color: #666;
display: none;
width: 100%;
height: 100%;
left: 0;
top: 0; /*FF IE7*/
filter: alpha(opacity = 50); /*IE*/
opacity: 0.5; /*FF*/
z-index: 1;
position: fixed !important; /*FF IE7*/
position: absolute; /*IE6*/
_top: expression(eval(document.compatMode &&
document.compatMode == 'CSS1Compat')?
documentElement.scrollTop+ (document.documentElement.clientHeight-this.offsetHeight)/2:
/*IE6*/
document.body.scrollTop+ (document.body.clientHeight- this.clientHeight)/2);
} .popIframe {
filter: alpha(opacity = 0); /*IE*/
opacity: 0; /*FF*/
}
-->
</style>
<script language="javascript" type="text/javascript">
function showDiv() {
document.getElementById('popDiv').style.display = 'block';
document.getElementById('popIframe').style.display = 'block';
document.getElementById('bg').style.display = 'block';
}
function closeDiv() {
document.getElementById('popDiv').style.display = 'none';
document.getElementById('bg').style.display = 'none';
document.getElementById('popIframe').style.display = 'none';
}
</script>
</head>
<body>
<div id="popDiv" class="mydiv" style="display: none;">
aaaaaaaaa <br>
<a href="javascript:closeDiv()">关闭窗口</a>
</div>
<div id="bg" class="bg" style="display: none;"></div>
<a href="javascript:showDiv()">点击这里弹出层</a>
<iframe id='popIframe' class='popIframe' frameborder='0'></iframe>
</body>
</html>
Html-Css-div透明层剧中的更多相关文章
- CSS + DIV 让页脚始终底部
一 前言 经常设计页面时用到三层DIV,头DIV与脚DIV一般固定高度,而中间层DIV根据内容的多少,高度不定,我们经常希望但内容很少时,脚DIV保持在底部,当内容很多时,脚DIV被中间内容挤到下面, ...
- HTML CSS + DIV实现整体布局
HTML CSS + DIV实现整体布局 1.技术目标: 开发符合W3C标准的Web页面 理解盒子模型 实现DIV+CSS整体布局 2.什么是W3C标准? W3C:World Wide Web Con ...
- CSS+DIV两栏式全屏布局
在网上找了很久,发现大部分都是固定宽度设置两栏,全屏情况下的布局很少.最后终于完成了,写出来备查,也供大家参考. <!DOCTYPE html PUBLIC "-//W3C//DTD ...
- CSS + DIV 让页脚始终保持在页面底部
来源:David's Blog http://www.DavidQiu.com/ 文章链接:http://blog.davidqiu.com/post/2013-06-17/400517539 ...
- div垂直居中 css div盒子上下垂直居中
div垂直居中 css div盒子上下垂直居中,让DIV盒子在任何浏览器中任何分辨率的显示屏浏览器中处于水平居中和上下垂直居中. div垂直居中常用于单个盒子,如一个页面里只有一个登录布局,使用div ...
- HTML CSS + DIV实现局部布局
HTML CSS + DIV实现局部布局 HTML CSS + DIV实现局部布局 1.本章教大家掌握2种布局方式: 1)顶部导航菜单布局,效果图: 2)购物版块布局,效果图: 2.技术目标: 使用d ...
- CSS+DIV常用命名
常用的符合CSS+DIV规则的命名 页头:header 登录条:loginBar 标志:logo 侧栏:sideBar 广告:banner 导航:nav 子导航:subNav 菜单:menu 子菜单: ...
- 基于CSS+dIV的网页层,点击后隐藏或显示
一个基于CSS+dIV的网页层,用JavaScript结合Input按钮进行控制,点击后显示或隐藏,网页上常用到的特效之一,实用性较强,相信对大家的前端设计有帮助. <!DOCTYPE html ...
- 系列文章--精通CSS.DIV网页样式与布局学习
精通CSS.DIV网页样式与布局(八)——滤镜的使用 精通CSS.DIV网页样式与布局(七)——制作实用菜单 精通CSS.DIV网页样式与布局(六)——页面和浏览器元素 精通CSS.DIV网页样式与布 ...
- css+div网页设计(二)--布局与定位
在网页设计中,能否控制好各个模块中在页面中的位置是非常关键的,与传统的表格定位不同,css+div定位方式更加的灵活,本篇博客将为大家介绍css+div的布局与定位. 一.盒子模型 由图可以看出 盒子 ...
随机推荐
- 深度优先搜索 codevs 1065 01字符串
codevs 1065 01字符串 时间限制: 1 s 空间限制: 128000 KB 题目等级 : 黄金 Gold 题目描述 Description 输出仅有0和1组成的长度为n的字符串,并且 ...
- Zbrush 4R7 P3中各类模型怎么快速隐藏
在ZBrush®软件中除了遮罩功能可以对模型局部进行编辑外,我们还可以通过显示和隐藏来对模型的局部进行控制. 查看更多内容请直接前往:http://www.zbrushcn.com/jichu/xia ...
- 【转】Python中string的strip,lstrip,rstrip用法
Python中的strip用于去除字符串的首尾字符串,同理,lstrip用于去除左边的字符,rstrip用于去除右边的字符. 这三个函数都可传入一个参数,指定要去除的首尾字符. 需要注意的是,传入的是 ...
- 两道相似KMP题
1.POJ 3450 Coporate Identity 这两题的解法都是枚举子串,然后匹配,像这种题目以后可以不用KMP来做,直接字符串自带的strstr函数搞定,如果字符串未出现,该函数返回NUL ...
- 第51课 C++对象模型分析(下)
1. 单继承对象模型 (1)单一继承 [编程实验]继承对象模型初探 #include <iostream> using namespace std; class Demo { protec ...
- Linux压力测试工具Tsung安装、使用和图形报表生成
简介 Tsung 是一个压力测试工具,可以测试包括HTTP, WebDAV, PostgreSQL, MySQL, LDAP, and XMPP/Jabber等服务器.针对 HTTP 测试,Tsung ...
- Tsung测试openfire服务器
环境准备 安装Tsung.安装openfire.安装Spark Tsung使用 要对openfire进行压力测试,因此我们主要讲解如何利用jabber_register.xml在openfire上面注 ...
- KVM虚拟机CPU说明
废话不多说了,下面对kvm虚拟机的CPU说明做一梳理:NUMA技术介绍NUMA是一种解决多CPU共同工作的技术方案,我们先回顾下多CPU共同工作的技术架构历史.多CPU共同工作主要有三种架构,分别是S ...
- 003医疗项目-关于<context:property-placeholder location="classpath:db.properties"/>的问题
项目结构如下:
- 14Spring_AOP编程(AspectJ)_环绕通知
在目标方法执行前后,进行代码增强 (阻止目标方法的执行 ) 环绕通知实现任何通知效果. 案例如下: 案例结构: