margin:0 auto;生效条件 1、position:absolute下不生效 原因:position:absolute只能相对于父元素进行定位top、left定位,相当于浮在父元素上面,所以margin:0 auto;就没有了参考值