用js、css 弹出窗口

来源:互联网 发布:react 源码 component 编辑:程序博客网 时间:2024/05/20 03:44

在摒弃了框架后发现好多东西要自己写了。今天碰到个弹框的问题,也来博客添个砖;

<html><head><title></title><style>.two {display: none;position: absolute;top: 0%;left: 0%;width: 100%;height: 100%;background-color: black;z-index: 50;-moz-opacity: 0.8;opacity: .80;filter: alpha(opacity=80);}.one {display: none;position: absolute;top: 25%;left: 25%;width: 50%;height: 50%;padding: 16px;border: 16px solid orange;background-color: white;z-index: 51;overflow: auto;}</style></head><body><a href="javascript:void(0)" onclick="document.getElementById('one').style.display='block';document.getElementById('two').style.display='block'">open</a><div id="one" class="one"><a href="javascript:void(0)" onclick="document.getElementById('one').style.display='none';    document.getElementById('two').style.display='none'">close</a></div><div id="two" class="two"></div></body></html>


原创粉丝点击