1、绝对定位:
父元素:
position: relative;
子元素:
position: absolute;
left: 50%;
top: 50%;
transform: translate(-50%,-50%);
2、flex布局&margin:
父元素:
display: flex;
子元素:
margin: auto auto;
3、纯flex布局:(要注意主轴方向)
父元素:
display: flex;
justify-content: center;
align-items: center;