Private archive copy · Unofficial site · Content copyright belongs to Runoob Tutorial and the original authors · View Original

CSS clear property

CSS clear property

Example

Specify that no floating elements are allowed on the left or right side of a paragraph:

img

{

float:

left

;

}

p

.clear

{

clear:

both

;

}

Try it »

More examples at the bottom of this page.


Property definition and usage

The clear property specifies whether floating elements are allowed on the left or right side of a paragraph.

Default value: none
Inheritance: no
Version: CSS1
JavaScript syntax: object.style.clear="left"

Browser support

The numbers in the table indicate the first browser version that supports this property.

property
clear 1.0 5.0 1.0 1.0 6.0

Attribute values

Value Description
left Floating elements are not allowed on the left side.
right Floating elements are not allowed on the right side.
both Floating elements are not allowed on either the left or right side.
none Default value. Floating elements are allowed on both sides.
inherit Specifies that the value of the clear property should be inherited from the parent element.

Related Articles

CSS Tutorial: CSS Float