CSSclear Property
Example
The <p> element is pushed below left floated elements (the <p> element do not allow floating elements on the left side):
img {
float: left;
}
p.clear {
clear: left;
}
Try it Yourself »float: left;
}
p.clear {
clear: left;
}
Definition and Usage
Theclear property controls the flow next to floated elements.
Theclear property specifies what should happen with the element that is next to a floating element.
Tip: Also look at thefloat property.
| Default value: | none |
|---|---|
| Inherited: | no |
| Animatable: | no.Read aboutanimatable |
| Version: | CSS1 |
| JavaScript syntax: | object.style.clear="both"Try it |
Browser Support
The numbers in the table specify the first browser version that fully supports the property.
| Property | |||||
|---|---|---|---|---|---|
| clear | 1.0 | 5.0 | 1.0 | 1.0 | 6.0 |
CSS Syntax
clear: none|left|right|both|initial|inherit;
Property Values
| Value | Description | Demo |
|---|---|---|
| none | Default. The element is not pushed below left or right floated elements | Demo ❯ |
| left | The element is pushed below left floated elements | Demo ❯ |
| right | The element is pushed below right floated elements | Demo ❯ |
| both | The element is pushed below both left and right floated elements | Demo ❯ |
| initial | Sets this property to its default value.Read aboutinitial | |
| inherit | Inherits this property from its parent element.Read aboutinherit |
Related Pages
CSS tutorial:CSS Float
HTML DOM reference:clear property

