html
<div class="zhehzao">
<div class="tankaung">在屏幕水平垂直居中</div>
<div>
css
.zhezhao{
width: 100%;
height: 100%;
position: fixed;
z-index: 10000;
top:0;
background: rgba(0,0,0,.5);
display: flex;
align-items: center;
}
.tankaung{
width: 100px;
height: 100px;
margin: 0 auto
}
网友评论