freeCodeCamp/guide/chinese/css/properties/clear-property/index.md

877 B

title localeTitle
Clear Property 清除财产

清除财产

您可以使用clear属性按下元素,防止它出现在先前浮动元素旁边。

clear属性可以具有以下值:

在之后使用该属性float属性用于“清除”出float

clear: none; 
 clear: left; 
 clear: right; 
 clear: both; 
 clear: inline-start; 
 clear: inline-end; 

例:

Clear Property Image

在上面的例子中,黄色div具有属性float:left ,并且可以适合珊瑚div 。但是,由于黄色div也具有clear: both的属性clear: both向下移动到浮动元素下方。

更多信息: