<html>
<head>
<title>弹窗小demo</title>
</head>
<body>
<button onclick="document.getElementById('pop1').style.display='block'">打开弹窗</button>
<!-- 弹窗组件 -->
<div id="pop1" style="display:none;width:100vw;height:100vh;background-color:#cccccc69;;top: 0;position: absolute;left: 0;text-align:center">
<div style="width:500px;height:400px;text-align:center;background-color:#fff;margin:calc((100vh - 400px)/2) auto">
<div style="width:500px;height:50px;border-bottom:1px solid #ccc">
<div style="line-height:50px;font-size:25px;width:100%;float:left">标题</div>
<label onclick="document.getElementById('pop1').style.display='none'" style="line-height:50px;font-size:25px;float:right;position: absolute;margin-left: -30px;cursor:pointer">×</label>
</div>
<div style="width:500px;height:450px;">
<p>弹窗内容</p>
<p>弹窗内容</p>
<p>弹窗内容</p>
<p>弹窗内容</p>
<p>弹窗内容</p>
<p>弹窗内容</p>
</div>
</div>
</div>
<!-- 弹窗组件 -->
</body>
</html>
html弹窗小demo,无任何依赖,简单通俗易懂
最后编辑于 :
©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。
推荐阅读更多精彩内容
- “小白!对象方法里面调用自己的属性怎么调用?” “this.语法调用啊!” 老朱说:“没事我就是随便问问,今天我们...
- 背景: 最近项目中接触到接口回调,以及Android弹窗PopWindow组件的使用,现在利用学到的知识自己写了一...
- 国际惯例 先看效果: 不想听我叨逼叨的同学可直接下载Demo:git地址 DialogFragment碎碎念: D...
- 效果 最后实现效果如下: 正文 Reserved 下载地址 github下载地址:https://github.c...