1、定位
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
2、弹性盒子
/* css3弹性居中:不知道值,直接用属性 */
display: flex;
/* 水平 */
justify-content: center;
/* 垂直 */
align-items: center;
3、margin:只是在水平方向居中
margin:0 auto;