Prohibit floating objects on the left side of the text in an element:
document.getElementById("demo").style.clear = "left";
Try it Yourself »
The clear property sets or returns the position of the element relative to floating objects.
Property | |||||
---|---|---|---|---|---|
clear | Yes | Yes | Yes | Yes | Yes |
Return the clear property:
object.style.clear
Set the clear property:
object.style.clear = "none|left|right|both|initial|inherit"
Value | Description |
---|---|
none | Allows floating objects on both sides of the element. This is default |
left | No floating objects allowed on the left side of the element |
right | No floating objects allowed on the right side of the element |
both | No floating objects allowed on either the left or right side of the element |
initial | Sets this property to its default value. Read about initial |
inherit | Inherits this property from its parent element. Read about inherit |
Default Value: | none |
---|---|
Return Value: | A String, representing the position of an element relative to floating objects |
CSS Version | CSS1 |
Return the clear property:
alert(document.getElementById("demo").style.clear);
Try it Yourself »
CSS tutorial: CSS Float
CSS reference: clear property
截取页面反馈部分,让我们更快修复内容!也可以直接跳过填写反馈内容!