Search within TutorialsPark

CSS clear Property


To prevent a floating element from being placed against another floating element


Definition and Notes.

1. The CSS clear property prevents an element from wrapping around a floated element. Instead, the cleared element is forced below the bottom of the floated element.

2.By Default, the elements stack up next to each other, this can be prevented by specifying that one or both the edges of the floating element must not float against another floating element.

Syntax:

CSS clear property. internetexplorer safari firefox opera chrome

View in Splitscreen»

Code-Editor:

Note-The 4th paragraph has clear property set to "left", hence it is at left extreme, with left side cleared completely.

Property Values

Value Description
left Pushes the element to a new line below any left-floated elements
right Pushes the element to a new line below any right-floated elements
both Pushes the element to a new line below any floated element
none The element is not cleared and either edge may float against another floating element

Specifications

Specs Value
Name clear
Value left | right | both | none
Initial Value none
Applies to Block-level elements
Javascript syntax object.style.clear="both"
Inherited Yes
Computed Value Same as declared value.
Browser Support internetexplorer safari firefox opera chrome

Related Examples.