效果:

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. 异常机制(Exception)

    异常机制(Exception) 异常程序是指程序运行中出现的不期而至的各种状况,如文件找不到,网络连接失败,非法参数等. 异常发生在程序运行期间,它影响了正常的程序执行流程 检查性异常 最具代表性的检 ...

  2. python_f-string格式化字符串文字

    一.简介 f-string,亦称为格式化字符串常量(formatted string literals),是Python3.6新引入的一种字符串格式化方法. f-string在形式上是以 f 或 F ...

  3. c++14新特性

    1.函数返回值类型推导 c++14对函数返回类型推导规则做了优化: auto func(int i) { //C++11编译非法,c++14支持auto返回值类型推导 return i; } int ...

  4. 【然天一】随机读写(4k)百盘天梯

    随机读写适用于大量小文件的读写,是最贴近办公和编程的使用场景.现在很多硬盘厂商只宣传它们的连续读写(Seq),但除了游戏和视频剪辑场景之外并没有什么卵用. 总结一下: 傲腾秒杀全部 NAND SLC ...

  5. CEH v8~v11 Module Slides 和 Lab Manual 下载

    课程内容 CEH v8 01 Introduction to Ethical Hacking CEH v8 02 Footprinting and Reconnaissance CEH v8 03 S ...

  6. 如何高效地写 Form

    工作少不了写"增删改查","增删改查"中的"增"和"改"都与 Form 有关,可以说:提升了 Form 的开发效率,就提 ...

  7. javac、java、javap 的使用详解

    简介 JDK中常用命令 切换目录 切换目录 进入D:\zs 第一种 第二种 其他常用命令 cls: 实现清屏 cd..: 切换到上一级目录 javac 简介 来编译.java文件的.命令行下直接输入j ...

  8. 微服务与SpiringBoot

    微服务: 微服务是一种架构风格,一般说到微服务都会说"微服务架构",即一个系统的各个功能(如结账,用户等)独立出来,以及各个服务独立出来,每个模块是可独立替换.可独立升级的软件单元 ...

  9. 大话devops

    一.敏捷的局限性的促使devops诞生 敏捷的局限性:敏捷只注重开发阶段的敏捷,未涉及到整个产品生命周期流程其他环节导致采用敏捷开发流程后效果不明显. devops成为企业数字化转型的助推器,扮演基础 ...

  10. 一次Kafka内存泄露排查经过

    一.现象 服务部署后内存总体呈上升趋势 二.排查过程 通过go tool pprof收集了三天内存数据 2月11号数据: 2月14号数据: 2月15号数据: 可以看到newPartitionProdu ...