CSS弹出背景半透明窗口
来源:互联网 发布:mysql source失败 编辑:程序博客网 时间:2024/06/08 12:24
文章来源 及 运行效果查看:http://www.codefans.net/jscss/code/3626.shtml
CSS弹出层,或者说是弹出窗口,背景半透明风格的弹出框,在网站登录、用户注册、公告提示方面都非常适合使用。IE和FF,OP均可以~弹出窗口,背景半透明
先说原理:两个层,一个高度和宽度都是100%,另一个就是你要弹出的窗口的具体内容,半透明在IE中是用filter: Alpha(opacity=60);在非IE中用opacity:0.60;两个层,一个高度和宽度都是100%,另一个就是你要弹出的窗口的具体内容,半透明在IE中是用filter: Alpha(opacity=60);在非IE中用opacity:0.60;
<!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=utf-8" /><title>弹出窗口,背景半透明</title><style type="text/css">body{margin:0px;}#bg{width:100%;height:100%;top:0px;left:0px;position:absolute;filter: Alpha(opacity=50);opacity:0.5; background:#000000; display:none;}#popbox{position:absolute;width:400px; height:400px; left:50%; top:50%; margin:-200px 0 0 -200px; display:none; background:#666666;}</style><script type="text/javascript">function pupopen(){ document.getElementById("bg").style.display="block"; document.getElementById("popbox").style.display="block" ;}function pupclose(){document.getElementById("bg").style.display="none"; document.getElementById("popbox").style.display="none" ;}</script></head><body>终于搞定这个效果了,IE和FF,OP均可以~先说原理:两个层,一个高度和宽度都是100%,另一个就是你要弹出的窗口的具体内容,半透明在IE中是用filter: Alpha(opacity=60);在非IE中用opacity:0.60;</br><a href="#" onclick="pupopen()">点击这里打开窗口</a><div id="bg"></div><div id="popbox">两个层,一个高度和宽度都是100%,另一个就是你要弹出的窗口的具体内容,半透明在IE中是用filter: Alpha(opacity=60);在非IE中用opacity:0.60;<br><br><br><a href="#" onclick="pupclose()">点击关闭窗口</a></div></body></html>
0 0
- CSS弹出背景半透明窗口
- 弹出窗口,页面背景逐渐变为半透明
- JavaScript 弹出登陆窗口背景半透明可拖动效果
- iOS 模态窗口居中弹出背景半透明
- CSS背景半透明效果
- CSS背景半透明
- popuwindow弹出时,背景半透明
- popupwindow 底部弹出+背景半透明
- css使背景变半透明,和js结合在一起可以达到使背景动态半透明弹出对话框的效果
- css 全局背景半透明 IE浏览器半透明
- 弹出窗口悬浮,背景页面变灰,类似网易邮箱的半透明信息提示效果
- 弹出窗口悬浮,背景页面变灰,类似网易邮箱的半透明信息提示效果
- 背景半透明CSS兼容设置
- popupwindow弹出后,屏幕背景变成半透明
- 实现popupwindow弹出后背景办成半透明
- Android Alertdialog弹出框设置半透明背景
- Android弹出popupWindow 背景变暗(背景半透明)(两种写法)
- 讲怎么CSS实现背景半透明效果
- 解析XML【C#】
- 黑马程序员--02常量和进制的学习
- 软中断
- LeetCode总结 -- kSum篇
- DOM4J实例
- CSS弹出背景半透明窗口
- 纸箱厂管理软件 在实际中的应用
- Cocos2D-X射击小游戏(一)游戏分析
- Hbase扫描
- 压缩和解压文件的工具类(ant-1.8.4.jar)
- ASP.NET中Server.Transfer用法
- HDU—2035—人见人爱A^B—【快速幂取模】
- HTTP请求和响应格式详解
- IOS学习之蓝牙4.0