html5实现弹出提示框,并且伴随遮罩层并且可以关闭弹出框

来源:互联网 发布:高考奇迹知乎 编辑:程序博客网 时间:2024/06/10 19:11
  1. <!DOCTYPE html>  
  2. <html>  
  3. <head lang="en">  
  4.     <meta charset="UTF-8">  
  5.     <title></title>  
  6.     <script src="js/jquery-1.8.3.min.js"></script>  
  7.     <style>  
  8.         *{padding0margin0}  
  9.         .box{  
  10.             positionfixed;  
  11.             width100%;  
  12.             height100%;  
  13.             background: rgba(0,0,0,0.2);  
  14.             displaynone;  
  15.         }  
  16.         .box1{  
  17.             width500px;  
  18.             height500px;  
  19.             positionfixed;left: 50%; top: 25%;  
  20.             margin-left-250px;  
  21.             border1px solid #000000;  
  22.         }  
  23.     </style>  
  24.     <script>  
  25.    
  26.     </script>  
  27. </head>  
  28. <body>  
  29.     <div class="box">  
  30.         <div class="box1">  
  31.             <a href="javascript:;" onclick="jQuery('.box').hide()" class="close">关闭</a>  
  32.         </div>  
  33.     </div>  
  34.     <a href="javascript:;" onclick="jQuery('.box').show()" class="show">显示</a>  
  35. </body>  
  36. </html>
阅读全文
0 0
原创粉丝点击