效果:

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
- js点击弹出div层
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/ ...
- 工作当中实际运用(3)——js原生实现鼠标点击弹出div层 在点击隐藏
function onmou(){ var divs=document.getElementById('kefuDV');//获取到你要操作的div if (divs.style.display==& ...
- 使用js弹出div刷新时闪烁解决方法
<div style="visibility: hidden"> //弹出div内容 </div>
- js弹出div层内容(按回退键关闭div层及遮罩)
<!--弹出的div列表对应的详情--> <div id="newhtml" class="white_content"> <di ...
- jQuery实现打开网页自动弹出遮罩层或点击弹出遮罩层功能示例
本文实例讲述了jQuery实现打开网页自动弹出遮罩层或点击弹出遮罩层功能.分享给大家供大家参考,具体如下: 弹出层:两种方式 一是打开网页就自动弹出层二是点击弹出 <!DOCTYPE html ...
- 创建一个弹出DIV窗口
创建一个弹出DIV窗口 摘自: http://www.cnblogs.com/TivonStone/archive/2012/03/20/2407919.html 创建一个弹出DIV窗口可能是现在 ...
- 点击弹出 +1放大效果 -- jQuery插件
20140110更新: <!doctype html> <html> <head> <meta charset="UTF-8"> & ...
- jquery---点击弹出层
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/ ...
- js弹窗 js弹出DIV,并使整个页面背景变暗
1.首先写一个遮罩层div,然后再写一个弹窗的div <!-- 遮罩层 --> <div id="cover" style="background: # ...
随机推荐
- Go 结构体方法
#### Go 结构体方法本来今天有些事情忙的不准备更新内容了,后来提前完成了, 所以还是要更新了; 毕竟坚持本就是一件不容易的事情!加油,相信不管是大家还是我,都有一些事情想要做,那就坚持吧,剩下的 ...
- Water 2.5 发布,一站式服务治理平台
Water(水孕育万物...) Water 为项目开发.服务治理,提供一站式解决方案(可以理解为微服务架构支持套件).基于 Solon 框架开发,并支持完整的 Solon Cloud 规范:已在生产环 ...
- Ubuntu 18.04 安装教程
准备材料 Ubuntu安装U盘 足够的硬盘空间 未初始化的硬盘需要提前初始化 注意事项 Ubuntu安装盘的制作请参考我的另外一个博客,里面写清楚了怎么制作Ubuntu安装盘,步骤非常简单 请将要拿给 ...
- C语言中数组长度不能用变量定义吗?
C语言里,所有变量空间都是在程序运行之初向系统申请的,包括指针,除了一些动态申请方式如malloc函数.没有申请的空间系统是不允许读写的.那么如果一个数组大小是变量定义,则在程序运行前不能确定数组大小 ...
- Idea 中使用Lombok找不到其自动生成的方法
问题描述 在我的Idea已经安装Lombok插件还有已经导入Lombok jar包依赖的情况下,仍然找不到其自动生成的方法. 问题分析 从各方大佬那里得知,Lombok通过Pluggable Anno ...
- errorC2471:cannot update program database vc90.pdb
解决办法: C/C++ | General | Debug Information format | C7 Compatible (/Z7) C/C++ | Code Generation | Ena ...
- UIFont
UIFont代表字体,常见创建方法有以下几个:+ (UIFont *)systemFontOfSize:(CGFloat)fontSize; 系统默认字体+ (UIFont *)boldSystemF ...
- SpringBeanUtils的部分方法类
原创:转载需注明原创地址 https://www.cnblogs.com/fanerwei222/p/12060553.html SpringBeanUtils的部分方法类: import java. ...
- Redis 哨兵模式
主从切换技术的方法是:当主服务器宕机了,需要手动将一台从服务器切换为主服务器,这就需要人工干预,这可能会造成一段时间的服务不可用. 一.哨兵模式的概述: 哨兵是一个独立的进程,作为一个进程,他会独立地 ...
- 隐藏键盘的N种方法
---Created by luo.h 显示键盘 [textField becomeFirstResponder]; 隐藏键盘 @interface ViewController ()<UITe ...