1.文字水平居中是 text-align:center,而且还可以让行内元素和行内块居中对齐。 2.块级盒子水平居中 左右margin改为auto 补充: 让块级盒子水平居中必须得有宽度,其次再将margin改为auto