水平居中 设置margin:0 auto; 注意点:如果使用了绝对定位,就无效了,这时候就要设置为 position:absolute; left:50%; margin-left: - 要居中的元素的宽度的一半;