css
常见的水平居中实现方案
- flex布局方案
<div class="father">
<div class="son"></div>
</div>
.father{
width:100%;
height:20%;
background-color:red;
display:flex;
justify-content: center;
align-items: center;
}
.son{
width:50%;
height:50%;
background-color:blue;
}
标签:flex,width,color,前端,50%,笔记,height,面试,background
From: https://www.cnblogs.com/marshban/p/17664960.html