好得很程序员自学网

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

子元素的margin-top作用于外层父元素解决方法_html/css_WEB-ITnose

子元素的margin-top作用于外层父元素解决方法:
有时候在设置子元素的margin-top属性的时候,本来是要作用于父元素,但是表现的结果却是父元素具有了margin-top效果,下面就通过代码实例介绍一下如何解决此问题。
代码实例如下:

      蚂蚁部落  #box{  width:200px;  height:200px;  background:red;  overflow:hidden;}#main{  width:50px;  height:50px;  background:blue;  margin-top:50px;}  

查看更多关于子元素的margin-top作用于外层父元素解决方法_html/css_WEB-ITnose的详细内容...

  阅读:32次