好得很程序员自学网

<tfoot draggable='sEl'></tfoot>

为什么margin的auto属性值失效了_html/css_WEB-ITnose

为什么margin的auto属性失效了:
建议:尽可能的手写代码,可以有效的提高学习效率和深度。
通常情况下,可以使用margin:0px auto将对象设置为水平居中对齐。这是因为auto属性值能够使浏览器自动为对象判断外边距大小,但是在下面的情况下却失效了。代码如下:

      蚂蚁部落  .parent{  width:300px;  height:200px;  border:1px solid red;}.children{  width:200px;  height:100px;  background-color:green;  position:absolute;  margin:0px auto;}   

查看更多关于为什么margin的auto属性值失效了_html/css_WEB-ITnose的详细内容...

  阅读:32次