clear:both后margin-top不起作用其他左右下都起作用
网站建设 2023-01-28 21:39www.1681989.com免费网站
如
<div style="float:left;">float:left</div>
<div style="clear:both;marg-:20px;marg-bottom:20px;background: red;marg-right: 20px;">clear:both</div>
2222222222222222222
前面那个DIV浮动的div的marg是起作用的;
后面那个DIVclear:both后,只有marg-不起作用,其他的左右下都起作用;
复制代码
代码如下:<div style="float:left;">float:left</div>
<div style="clear:both;marg-:20px;marg-bottom:20px;background: red;marg-right: 20px;">clear:both</div>
2222222222222222222
前面那个DIV浮动的div的marg是起作用的;
后面那个DIVclear:both后,只有marg-不起作用,其他的左右下都起作用;