设为首页收藏本站关注微信<<< 抵制 IE6 人人有责 >>>
搜索
热搜: 活动 交友 discuz
查看: 2167|回复: 0
打印 上一主题 下一主题

[CSS] 点击文字弹出一个DIV层窗口代码

[复制链接]
跳转到指定楼层
楼主
发表于 2015-1-4 19:05:10 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式

  1. <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
  2. <html>
  3.     <head>
  4.         <title>点击文字弹出一个DIV层窗口代码</title>
  5.         <style>
  6.         .black_overlay{
  7.             display: none;
  8.             position: absolute;
  9.             top: 0%;
  10.             left: 0%;
  11.             width: 100%;
  12.             height: 100%;
  13.             background-color: black;
  14.             z-index:1001;
  15.             -moz-opacity: 0.8;
  16.             opacity:.80;
  17.             filter: alpha(opacity=88);
  18.         }
  19.         .white_content {
  20.             display: none;
  21.             position: absolute;
  22.             top: 25%;
  23.             left: 25%;
  24.             width: 55%;
  25.             height: 55%;
  26.             padding: 20px;
  27.             border: 10px solid orange;
  28.             background-color: white;
  29.             z-index:1002;
  30.             overflow: auto;
  31.         }
  32.     </style>
  33.     <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
  34.     </head>
  35.     <body>
  36.         <p>示例弹出层:<a href = "javascript:void(0)" onclick = "document.getElementById('light').style.display='block';document.getElementById('fade').style.display='block'">请点这里</a></p>
  37.         <div id="light" class="white_content">这是一个层窗口示例程序. <a href = "javascript:void(0)" onclick = "document.getElementById('light').style.display='none';document.getElementById('fade').style.display='none'">点这里关闭本窗口</a></div>
  38.         <div id="fade" class="black_overlay"></div>
  39.     </body>
  40. </html>
复制代码


分享到:  QQ好友和群QQ好友和群 QQ空间QQ空间 腾讯微博腾讯微博 腾讯朋友腾讯朋友
收藏收藏 转播转播 分享淘帖
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 免费注册

本版积分规则

QQ|手机版|Archiver|源于生活(个人生活娱乐工作的笔记)css3,html5,学习笔记    

GMT+8, 2024-5-6 18:13 , Processed in 0.093600 second(s), 24 queries .

Powered by Mr.Kevin-ying

© 2004-2015

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