css居中显示的方法
01
定位法:position:absolute
margin-top,和margin-left的值均为高和宽值的一半。
02
margin:auto法
这个也可以是定位法。
margin:auto是水平垂直都居中,如果仅仅设置水平居中,可设置为margin:auto 0;同理,如果仅仅设置垂直居中,可设置为margin:0 auto.
03
display:table-cell法
这个方法主要针对多行文字内容的垂直居中对齐。
04
transform:translate(x,y)法