1. flex布局
父元素设置
display: flex;
justify-content: center;
align-items: center;
2. gird布局
父元素设置
display: grid;
justify-items: center;
align-items: center;
3. absolute
父元素设置
positon:relative;
子元素设置
position: absolute;
left: 0;
right: 0;
top: 0;
bottom: 0;
margin: auto;