877 B
877 B
title | localeTitle |
---|---|
Clear Property | 清除财产 |
清除财产
您可以使用clear
属性按下元素,防止它出现在先前浮动元素旁边。
clear
属性可以具有以下值:
在之后使用该属性float
属性用于“清除”出float
。
clear: none;
clear: left;
clear: right;
clear: both;
clear: inline-start;
clear: inline-end;
例:
在上面的例子中,黄色div
具有属性float:left
,并且可以适合珊瑚div
。但是,由于黄色div
也具有clear: both
的属性clear: both
向下移动到浮动元素下方。