一、单行文本水平垂直居中
line-height = height 时 单行文本垂直居中
text-align: center 单行文本水平居中
二、元素垂直居中
1、Flex布局
父元素设置 display:flex
align-items: center 垂直方向居中
justify-content:center 水平方向居中
2、Flex布局,子元素align-self
3、子相父绝,子元素 top:50%,margin-top:height/2
top: 50%; margin-top:-15px; 垂直方向居中
left: 50%;margin-left:-15px; 水平方向居中
4、子绝父相,子元素 top:50%,transform与margin-top同理
5、子绝父相,margin:auto