设置DIV 左右居中。 如图所示: 需要设置两点: 1 设置DIV 的width属性即宽度。 2 设置div的margin-left和margin-right属性即可 代码如图: DIV居中 用Chrome调试发现 DIV 是处于居中的。