div{
position: absolute; /*绝对定位,相对父容器*/
top: 50%; /*弹窗左上角的点位于上下居中*/
left: 50%; /*弹窗左上角的点位于左右居中*/
margin-top: -3.79rem; /*margin在向上向左拉弹窗宽高的一半*/
margin-left: -2.8rem;
width: 5.6rem;
height: 7.58rem;
}
top,bottom,left,right都设置为比例 百分之多少 然后这个弹窗会随着页面的长短而伸缩改变