企业🤖AI Agent构建引擎,智能编排和调试,一键部署,支持私有化部署方案 广告
## clear 属性 ### 属性定义及使用说明 clear属性指定段落的左侧或右侧不允许浮动的元素。 JavaScript 语法:object.style.clear="left" * * * ## 属性值 | 值 | 描述 | | --- | --- | | left | 在左侧不允许浮动元素。 | | right | 在右侧不允许浮动元素。 | | both | 在左右两侧均不允许浮动元素。 | | none | 默认值。允许浮动元素出现在两侧。 | | inherit | 规定应该从父元素继承 clear 属性的值。 | * * * ## 实例--指定段落的左侧或右侧不允许浮动的元素: ``` <!DOCTYPE html> <html> <head> <meta charset="utf-8"> <title>W3Cschool教程(w3cschool.cn)</title> <style> img { float:left; } p.clear { clear:both; } </style> </head> <body> <img src="/attachments/cover/cover_css.png" width="95" height="84" /> <p>This is some text. This is some text. This is some text. This is some text. This is some text. This is some text.</p> <p class="clear">This is also some text. This is also some text. This is also some text. This is also some text. This is also some text. This is also some text.</p> </body> </html> ```