附代码
使用绝对定位与相对定位的方式 百分度的形式来写
.main {
width: 100%;
height: 100%;
background-color: #B2B2B2;
position: relative;
}
.section {
border-radius: .2rem;
position: absolute;
width: 90%;
height: 40%;
top: 50%;
left: 50%;
background: white;
transform: translate(-50%, -50%);
}