Clear Property: Do not allow floating elements on the left or the right side of a specified <p> element:
img {
float: left;
}p.clear {
clear: both;
}
Definition and Usage
The clear property specifies on which sides of an element floating elements are not allowed to float.
| Default value: | none |
|---|---|
| Inherited: | no |
| Animatable: | no. Read about animatable |
| Version: | CSS1 |
| JavaScript syntax: | object.style.clear=”both” Try it |
CSS Syntax
clear: none|left|right|both|initial|inherit;
Property Values
| Value | Description |
|---|---|
| none | Default. Allows floating elements on both sides |
| left | No floating elements allowed on the left side |
| right | No floating elements allowed on the right side |
| both | No floating elements allowed on either the left or the right side |
| initial | Sets this property to its default value. Read about initial |
| inherit | Inherits this property from its parent element. Read about inherit |
