css 弹框浏览器居中

.father {   width: 300px; height:150px;   position: relative;}.son {    position: absolute;    top: 0; right: 0; bottom: 0; left: 0;

 

 或

.class{ position: absolute; width: 100px; height: 100px; margin: auto; top: 0; right: 0; bottom: 0; left: 0; background: red; }

 

posted @ 2020-08-24 18:21  酷酷的城池  阅读(207)  评论(0)    收藏  举报