效果:

HTML:

<!-- 添加分组按钮 -->
            <div class="group_add" onclick = "document.getElementById('light').style.display='block';document.getElementById('fade').style.display='block'">
                <div class="group_add_icon">+</div>
                <div class="group_add_title">添加分组</div>
            </div>
            <!-- 遮罩层 -->
            <div id="light" class="content_box">
                <div class="content_box_one">添加分组</div>
                <div class="content_box_two">请输入新的分组名称</div>
                <div class="content_box_three">
                    <input type="text" placeholder="请输入分组名称" type="text" class="content_box_three_input">
                </div>
                <div class="content_box_four">
                    <div class="content_box_four_btn1" onclick = "document.getElementById('light').style.display='none';document.getElementById('fade').style.display='none'">取消</div>
                    <div class="content_box_four_btn2">确定</div>
                </div>
            </div>
            <div id="fade" class="black_overlay" onclick = "document.getElementById('light').style.display='none';document.getElementById('fade').style.display='none'"></div>
 
 
CSS(弹出内容、遮罩层样式)
/* 遮罩层 */
.black_overlay{
    display: none;
    position: absolute;
    top: 0%;
    left: 0%;
    width: 100%;
    height: 100%;
    background-color: black;
    z-index: 98;
    -moz-opacity: 0.8;
    opacity:.30;
    filter: alpha(opacity=88);
}
.content_box {
    display: none;
    position: absolute;
    overflow: auto;
    width: 76vw;
    height: 40vw;
    background-color: #fff;
    top: 34%;
    left: 12vw;
    z-index: 99;
}
.content_box_one {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    /* font-weight: bold; */
    letter-spacing: 1px;
    margin-top: 3vw;
    text-shadow: 0 0 1px #000;
}
.content_box_two {
    font-size: 14px;
    letter-spacing: 1px;
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: center;
    margin-top: 1vw;
}
.content_box_three {
    width: 80%;
    height: 8vw;
    margin-left: 10%;
    background-color: #ecf6f9;
    border-radius: 20vw;
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: center;
    margin-top: 2vw;
}
.content_box_three_input {
    background-color: #ecf6f9;
    outline: none;
    border: none;
    width: 84%;
    /* height: 26px; */
    /* margin-top: 3px; */
    /* margin-left: 5%; */
    font-size: 14px;
    letter-spacing: 1px;
}
.content_box_three_input::-webkit-input-placeholder {
    color: rgb(136, 136, 136);
    font-size: 14px;
}
.content_box_three_input:focus {
    color: #000;
    font-size: 14px;
}
.content_box_three_input:focus{
    border:none;
    font-size: 14px;
}
.content_box_four {
    width: 60vw;
    display: flex;
    flex-direction: row;
    margin-top: 5vw;
    margin-left: 8vw;
}
.content_box_four_btn1 {
    width: 12vw;
    background-color: #fff;
    border: 1px solid rgb(156, 156, 156);
    color: #000;
    margin-left: 12vw;
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: center;
    padding: 0.5vw 0;
    border-radius: 1.5vw;
}
.content_box_four_btn2 {
    width: 12vw;
    background-color: #00b3a8;
    border: 1px solid rgb(156, 156, 156);
    color: #fff;
    margin-left: 12vw;
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: center;
    padding: 0.5vw 0;
    border-radius: 1.5vw;
}
 
 
 
 
参考来源:https://www.jb51.net/article/112380.htm
 

点击弹出div内容包括遮罩层的更多相关文章

  1. js点击弹出div层

    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/ ...

  2. 工作当中实际运用(3)——js原生实现鼠标点击弹出div层 在点击隐藏

    function onmou(){ var divs=document.getElementById('kefuDV');//获取到你要操作的div if (divs.style.display==& ...

  3. 使用js弹出div刷新时闪烁解决方法

    <div style="visibility: hidden"> //弹出div内容 </div>

  4. js弹出div层内容(按回退键关闭div层及遮罩)

    <!--弹出的div列表对应的详情--> <div id="newhtml" class="white_content"> <di ...

  5. jQuery实现打开网页自动弹出遮罩层或点击弹出遮罩层功能示例

    本文实例讲述了jQuery实现打开网页自动弹出遮罩层或点击弹出遮罩层功能.分享给大家供大家参考,具体如下: 弹出层:两种方式 一是打开网页就自动弹出层二是点击弹出 <!DOCTYPE html ...

  6. 创建一个弹出DIV窗口

    创建一个弹出DIV窗口 摘自:   http://www.cnblogs.com/TivonStone/archive/2012/03/20/2407919.html 创建一个弹出DIV窗口可能是现在 ...

  7. 点击弹出 +1放大效果 -- jQuery插件

    20140110更新: <!doctype html> <html> <head> <meta charset="UTF-8"> & ...

  8. jquery---点击弹出层

    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/ ...

  9. js弹窗 js弹出DIV,并使整个页面背景变暗

    1.首先写一个遮罩层div,然后再写一个弹窗的div <!-- 遮罩层 --> <div id="cover" style="background: # ...

随机推荐

  1. java匿名内部类-应用

    1 package face_09; 2 3 import sun.jvm.hotspot.ui.action.ShowAction; 4 5 interface Inter{ 6 void show ...

  2. One Switch

    前言 One Switch 是由国内知名开发者 TualatriX 带来的最新作品,功能小巧精简,设计优雅,犹如一块多功能的遥控器,通过状态栏快捷菜单即可「一键」快速实现保持亮屏.切换 AirPods ...

  3. 从零开始, 开发一个 Web Office 套件 (2): 富文本编辑器

    书接前文: 从零开始, 开发一个 Web Office 套件 (1): 富文本编辑器 这是一个系列博客, 最终目的是要做一个基于HTML Canvas 的, 类似于微软 Office 的 Web Of ...

  4. URL Rewrite(四种重定向策略)

    目录 一:Rewrite基本概述 1.Rewrite简介 2.Rewrite基本概述 3.Rewrite作用 4.什么是URL? 二:rewrite语法 三:Rewrite标记Flag 1.last和 ...

  5. 什么是iptables?

    目录 一:iptables 1.iptables简介 2.什么是防火墙? 3.防火墙种类 二:iptables基本介绍 1.解析内容 三:iptables流程(讲解) 1.流入本机 2.解析(流入本机 ...

  6. Java应用程序OOM分析

    内存泄露:申请使用完的内存没有释放,导致虚拟机不能再次使用该内存,此时这段内存就泄露了,因为申请者不用了,而又不能被虚拟机分配给别人用. 内存溢出:申请的内存超出了JVM能提供的内存大小,此时称之为溢 ...

  7. SQL 语句实战演练

    1 创建数据库.删除数据库 备注:关键字不一定要大写. CREATE DATABASE sql_testDROP DATABASE sql_test 2 新建表 CREATE TABLE `emp` ...

  8. 微信小程序笔记整理--入门篇。

    7-2 微信小程序入门篇 准备篇 1.登录网址,https://mp.weixin.qq.com 注册一个微信小程序. 2.获取微信小程序appid,登录自己的小程序后台,在开发者设置中获得appid ...

  9. UDP数据包最大传输长度

    概念以太网(Ethernet)数据帧的长度必须在46-1500字节之间,这是由以太网的物理特性决定的.这个1500字节被称为链路层的MTU(最大传输单元). 但这并不是指链路层的长度被限制在1500字 ...

  10. JS 中的GB2312转UTF8和UTF8转GB2312

    转载请注明来源:https://www.cnblogs.com/hookjc/ JS:encodeURI encodeURI(URIString)必选的 URIString 参数代表一个已编码的 UR ...