CSS clear property

Examples

Left or right does not allow floating element specifies the paragraph:

img
{
float: left;
}
p.clear
{
clear: both;
}


Bottom of the page to see more examples.

Attribute definitions and instructions

Left or right side clear attribute specifies the paragraph does not allow floating elements.

Defaults: none
Inherited: no
version: CSS1
JavaScript syntax: object .style.clear = "left"


Browser Support

Figures in the table represent the first browser to support the version number of the property.

属性
clear 1.0 5.0 1.0 1.0 6.0

Property Value

value description
left On the left side floating elements are not allowed.
right On the right side floating elements are not allowed.
both In the left and right sides are not allowed to float elements.
none Defaults. Allow floating element appear on both sides.
inherit Clear provisions should inherit the property values ​​from the parent element.


related articles

CSS tutorial: CSS the Float