1.使用弹性盒子布局居中;对父容器设置
display: flex;
justify-content: center;
align-items: center;
2.使用定位居中;
对父容器设置
position: relative;
对子容器设置
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%,-50%);