原文发布时间为:2009-04-05 —— 来源于本人的百度文章 [由搬家工具导入]

有人会说,怎么网页用JavaScript会有安全提示,而其他网站上面用了JavaScript都没有安全提示,呵呵,那是因为你运行本地的网页会用安全提示,如果你网页放在服务器上面,让别人运行就不会有提示了。。呵呵,所以别担心了。。

第一个比较丑的,也比较简单的如下:

<html>
<head>
<title>LIGHTBOX EXAMPLE</title>
<style>
.black_overlay{
display: none;
position: absolute;
top: 0%;
left: 0%;
width: 100%;
height: 100%;
background-color: black;
z-index:1001;
-moz-opacity: 0.2;
opacity:.20;
filter: alpha(opacity=20);
}
.white_content {
display: none;
position: absolute;
top: 25%;
left: 25%;
width: 50%;
height: 50%;
padding: 16px;
border: 16px solid orange;
background-color: white;
z-index:1002;
overflow: auto;
}
</style>
</head>
<body>
<p> 可以根据自己要求修改css样式<a href = "javascript:void(0)" onclick = "document.getElementById('light').style.display='block'; document.getElementById('fade').style.display='block'">点击这里打开窗口</a></p>
<div id="light" class="white_content">This is the lightbox content. <a href = "javascript:void(0)" onclick = "document.getElementById('light').style.display='none';document.getElementById('fade').style.display='none'">Close</a></div>
<div id="fade" class="black_overlay"></div>
</body>
</html>

第二种做得比较好看:

<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>提示信息框</title>
<style type="text/css">
a{ color:#000; font-size:12px;text-decoration:none}
a:hover{ color:#900; text-decoration:underline}
body{background:;filter:progid:DXImageTransform.Microsoft.Gradient(gradientType=0,startColorStr=#ffffff,endColorStr=#003366); overflow:hidden}
#massage_box{ position:absolute; left:expression((body.clientWidth-350)/2); top:expression((body.clientHeight-200)/2); width:350px; height:200px;filter:dropshadow(color=#666666,offx=3,offy=3,positive=2); z-index:2; visibility:hidden}
#mask{ position:absolute; top:0; left:0; width:expression(body.clientWidth); height:expression(body.clientHeight); background:#666; filter:ALPHA(opacity=60); z-index:1; visibility:hidden}
.massage{border:#036 solid; border-width:1 1 3 1; width:95%; height:95%; background:#fff; color:#036; font-size:12px; line-height:150%}
.header{background:#036; height:10%; font-family:Verdana, Arial, Helvetica, sans-serif; font-size:12px; padding:3 5 0 5; color:#fff}
</style>
</head><body>
<div id="massage_box"><div class="massage">
<div class="header"><div style="display:inline; width:150px; position:absolute">本站提示信息</div>
<span onClick="massage_box.style.visibility='hidden'; mask.style.visibility='hidden'" style="float:right; display:inline; cursor:hand">×</span></div>
<ul style="margin-right:25"><li>
本人申明此博客所有文章(包括文章插图)均为原创,如需引用或转载请注明出处。
</li><li>欢迎大家对博文中观点留言评述,谢绝无聊人士无素质无观点的灌水漫骂。</li><li>本站已设背景音乐,听音乐盒中收集的音乐时请先到页面底部关闭背景音乐。</li></ul></div></div>
<div id="mask"></div>
<span onClick="mask.style.visibility='visible';massage_box.style.visibility='visible'" style="cursor:hand"><a href="#">显示提示信息</a></span>
</body>
</html>

最新文章

  1. Centos6.5 Openvpn的安装与配置
  2. javascript - 浏览器对象
  3. PAT乙级 1021. 个位数统计 (15)
  4. HDU-4035 Maze (概率DP求期望)
  5. ./configure --prefix=
  6. Pascal &lt;-&gt; C/C++ 转换简明教程
  7. 33.Spring整合Struts2.md
  8. poj1961 kmp
  9. 本地连接 vmware服务器
  10. 一次从0到1的java项目实践清单
  11. Redis学习笔记(二)Redis支持的5种数据类型的总结之String和Hash
  12. Android项目目录结构
  13. python脚本文件传参并通过token登录后爬取数据实例
  14. 带你深入理解STL之Set和Map
  15. 用HttpClientFactory来实现简单的熔断降级
  16. 华为mate10 UA
  17. 3.9 run_main.py源码(兼容python2和3)
  18. 【翻译】从头开始写一个时间序列数据库-Writing a Time Series Database from Scratch
  19. [AMPPZ2014]Jaskinia
  20. SpringDataSolr 过滤(或者叫筛选)查询

热门文章

  1. MySQL自学笔记_联结(join)
  2. C++ lambda 表达式 简介
  3. 十五、MySQL DELETE 语句
  4. js禁止微信浏览器下拉显示黑底查看网址
  5. API Star:一个 Python 3 的 API 框架
  6. JAVA使用JDBC连接,修改MySQL数据库(比较乱)
  7. Android四大基本组件介绍及生命周期
  8. Django runserver支持https
  9. python代码notepad++不变色问题。
  10. 配置Wampserver和安装thinksns