如果有人访问网站页面并且他们想从正文的网站页面移动,那么会弹出带有关闭按钮的表单。我就像弹出窗口一样工作,但关闭按钮不起作用。
如果可能的话,当我按下esc弹出表单时应该关闭(隐藏)。
<div class="popupBox"><button class="btn">x</button></div>
<style type="text/css">
.popupBox{
width: 400px;
height: 200px;
margin: 50px auto;
box-shadow: 0 0 5px rgba(0,0,0, 0.3);
position: relative;
display: none;
}
.popupBox .btn{
position: absolute;
width: 24px;
height: 24px;
text-align: center;;
border-radius: 100%;
color: #000;
top: -15px;
right: -15px;
cursor: pointer;
background: #f9f9f9;
}