效果:

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. 使用Hot Chocolate和.NET 6构建GraphQL应用(3) —— 实现Query基础功能

    系列导航 使用Hot Chocolate和.NET 6构建GraphQL应用文章索引 需求 在本文中,我们通过一个简单的例子来看一下如何实现一个最简单的GraphQL的接口. 实现 引入Hot Cho ...

  2. Maven的安装、配置与使用

    5.Maven 我为什么要学习这个技术? 在JavaWeb开发中,需要使用大量的jar包,我们手动去导入: 如何能够让一个东西自动帮我们导入和配置这个jar包. 由此,Maven诞生! 5.1.Mav ...

  3. Sklearn 与 TensorFlow 机器学习实用指南第二版

    零.前言 一.机器学习概览 二.一个完整的机器学习项目 三.分类 四.训练模型 五.支持向量机 六.决策树 七.集成学习和随机森林 八.降维 十.使用 Keras 搭建人工神经网络 十一.训练深度神经 ...

  4. JDK8 的 Lambda、Stream、LocalDate

    前言 本篇主要讲述是Java中JDK1.8的一些新语法特性使用,主要是Lambda.Stream和LocalDate日期的一些使用讲解. 作者:虚无境 来源:cnblogs.com/xuwujing/ ...

  5. linux 进程信号

    转载请注明来源:https://www.cnblogs.com/hookjc/ signal 函数的使用方法简单,但并不属于 POSIX 标准,在各类 UNIX 平台上的实现不尽相同,因此其用途受 到 ...

  6. 利用纯代码写出一个秒表表盘的方法 —— #DF

    @interface ViewController () @property (nonatomic, strong) CALayer *secLayer; // 秒针layer @property ( ...

  7. TCP三次握手和四次挥手【转】

    一. TCP/IP协议族 TCP/IP是一个协议族,通常分不同层次进行开发,每个层次负责不同的通信功能.包含以下四个层次: 1. 链路层,也称作数据链路层或者网络接口层,通常包括操作系统中的设备驱动程 ...

  8. 导航控制器跳转时隐藏底部tabbar

    - (void)setting { // 跳转到设置界面 XMGSettingViewController *settingVc = [[XMGSettingViewController alloc] ...

  9. 啥叫IP地址及子网掩码?

    啥叫IP地址及子网掩码 ??? 1.IP地址的定义及分类 1.1IP地址的定义 1.2IP地址的分类 2.子网掩码 1.1  互联网上连接的网络设备和计算机都有唯一的地址,此作为该主机在Interne ...

  10. Solution -「多校联训」消失的运算符

    \(\mathcal{Description}\)   Link.   给定长度为 \(n\) 的合法表达式序列 \(s\),其中数字仅有一位正数,运算符仅有 - 作为占位.求将其中恰好 \(k\) ...