点击文字,弹出层
Posted clear93
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了点击文字,弹出层相关的知识,希望对你有一定的参考价值。
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> <html> <head> <title>点击文字弹出一个DIV层窗口代码</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.8; opacity:.80; filter: alpha(opacity=88); } .white_content { display: none; position: absolute; top: 25%; left: 25%; width: 55%; height: 55%; padding: 20px; border: 10px solid orange; background-color: white; z-index:1002; overflow: auto; } </style> </head> <body> <p>示例弹出层:<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">这是一个层窗口示例程序. <a href = "javascript:void(0)" onclick = "document.getElementById(‘light‘).style.display=‘none‘;document.getElementById(‘fade‘).style.display=‘none‘">点这里关闭本窗口</a></div> <div id="fade" class="black_overlay"></div> </body> </html>
以上是关于点击文字,弹出层的主要内容,如果未能解决你的问题,请参考以下文章
jquery遮罩层遮挡不住图片是怎么回事,弹出层,网页背景透明那块,文字什么的都可以遮住
js点击任意区域弹出层消失,js点击弹出层之外的任意区域弹出层消失,常见弹层的封装