六狼论坛

 找回密码
 立即注册

QQ登录

只需一步,快速开始

新浪微博账号登陆

只需一步,快速开始

搜索
查看: 15|回复: 0

div 遮罩层

[复制链接]

升级  40%

4

主题

4

主题

4

主题

童生

Rank: 1

积分
20
 楼主| 发表于 2013-2-7 16:07:41 | 显示全部楼层 |阅读模式
<html><head>    <title></title>       <script type="text/javascript">           function show() {               document.getElementById("forbidden").style.display = "";               document.getElementById("content").style.display = "";               //透明度               document.getElementById("forbidden").style.filter = "Alpha(Opacity=50)";               document.getElementById("content").innerHTML = "你的内容<input onclick='hide()' type='button' value='确定'/>";           }           function hide() {               document.getElementById("forbidden").style.display = "none";               document.getElementById("content").style.display = "none";           }    </script></head><body><div style="width: 100%; background-color:Gray; display:none; height: 100%; position:absolute; left: 0; top: 0;" id="forbidden"></div><div style="width: 260px; background-color:Blue; display:none; height: 113px; position:absolute; left: 244px; top: 137px;" id="content"></div><div id="fuck"><input  type="button" value="显示"/></div></body></html>

摘要:在页面中放两个div 第一个宽高都设置成100% 第二个设置成自己想要的大小
您需要登录后才可以回帖 登录 | 立即注册 新浪微博账号登陆

本版积分规则

快速回复 返回顶部 返回列表