div 遮罩层 弹窗

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>div 遮罩层 弹窗</title>
<style type="text/css">
#Layer1 {
    height: 250px;
    width: 450px;
    border: 5px solid #999;
    margin-right: auto;
    margin-left: auto;
    z-index: 50;
    display: none;
    position: relative;
    background-color: #FFF;
}
#Layer1 #win_top {
    height: 30px;
    width: 450px;
    border-bottom-width: 1px;
    border-bottom-style: solid;
    border-bottom-color: #999;
    line-height: 30px;
    color: #666;
    font-family: "微软雅黑", Verdana, sans-serif, "宋体";
    font-weight: bold;
    text-indent: 1em;
}
#Layer1 #win_top a {
    float: right;
    margin-right: 5px;
}
#shade {
    background-color:#000;
    position:absolute;
    z-index:49;
    display:none;
    width:100%;
    height:100%;
    opacity:0.6;
    filter: alpha(opacity=60);
    -moz-opacity: 0.6;
    margin: 0px;
    left: 0px;
    top: 0px;
    right: 0px;
    bottom: 0px;
}
#Layer1 .content {
    margin-top: 5px;
    margin-right: 30px;
    margin-left: 30px;
}
body {
}
</style>
</head>

<body>
<div id="shade"></div>
<a href="#" onClick="shade.style.display=‘block‘;Layer1.style.display=‘block‘">打开</a> <br />
<br />
<br />
<br />
<div id="Layer1">
  <div id="win_top">雅比斯 - 我的个人代码库 <a href="#" onClick="shade.style.display=‘none‘;Layer1.style.display=‘none‘">关闭</a></div>
  <br />
  <div class="content"><a href="http://www.chinayabisi.com" target="_blank">http://www.chinayabisi.com</a></div>
</div>
</body>
</html>

说明:

#shade的高度设置的大一些就可以遮罩整个页面以下代码放置在body 开始位置 就可以在页面居中,不居中自己再调试一把吧
<div id="Layer1">
  <div id="win_top">雅比斯 - 我的个人代码库 <a href="#" onClick="shade.style.display=‘none‘;Layer1.style.display=‘none‘">关闭</a></div>
  <br />
  <div class="content"><a href="http://www.chinayabisi.com" target="_blank">http://www.chinayabisi.com</a></div>
</div>
时间: 2024-10-05 02:38:19

div 遮罩层 弹窗的相关文章

JS+CSS简单实现DIV遮罩层显示隐藏【转藏】

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" > <head> <title>DIV CSS遮罩层</title

jquery实现div遮罩层

1 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> 2 <html xmlns="http://www.w3.org/1999/xhtml"> 3 <head> 4 <meta http-equiv="

在iframe内页面完全加载完后,关闭父页面生成的div遮罩层

遮罩层div为iframe父页面生成,需在iframe内页面完全加载完后,关闭遮罩层 alertMsgClose() :函数为关闭遮罩层函数 此段代码在iframe页面内: <script> $(function () { window.parent.alertMsgClose();// iframe 外层页面关闭遮罩层 }); </script> 原文地址:https://www.cnblogs.com/tmdsleep/p/10984450.html

JQuery 遮罩层弹窗

var str = "<div id=\"zhezhao\" style=\"display:none; background-color: rgba(0,0,0,0.3); width: 100%; height: 100%; position: fixed; top: 0px; left: 0px; z-index: 9999;\">"; str += "<div id=\"tanchuang\"

DIV遮罩层传值

今天费了很大的劲儿才搞定!下面贴出代码和总结: 1.首先是前台代码: <%@ Page Title="" Language="C#" MasterPageFile="~/Main.Master" AutoEventWireup="true" CodeBehind="CategoryList.aspx.cs" Inherits="Bridgetree.Admin.CategoryList&qu

Jquery实现遮罩层,就是弹出DIV周围都灰色不能操作

<%@ page language="java" pageEncoding="UTF-8"%> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3

前端小结(3)---- 添加遮罩层,并弹出div

有如下div: <div id='pop-div' class="pop-box"> <div class="input-group has-info"> <input class="form-control" id="bankCode" type="text" placeholder="请输入银行卡号" /> <span class="

Mirror app HTML样式CSS之DIV遮罩背景层样式

设置背景图片后,如果背景图片颜色太亮,则建议放个div遮罩背景层-目前Google 放出的css中div遮罩层的样式: 1 /* Overlay gradient to allow text to be read over the image. */ 2 3 /* For cards with two lines of text (excluding footer) 4 * ex: hybrid templates & those needing more bottom readability

实现弹出层,遮罩层

开发中经常会用到弹出遮罩层的时候,下面是一个简单的遮罩层弹窗 <style type="text/css"> <!-- body,td,th { font-size: 12px; padding:0; margin:0; } .tanchuang{ width:100px; height:100px;position:absolute;left: 0px;top: 0px;z-index:100; display:none;} .box{width:600px;z-i