clear
Anonymous contributor
Anonymous contributor3071 total contributions
Anonymous contributor
Published Jul 31, 2021Updated Jan 18, 2024
Contribute to Docs
Specifies whether an element coming after a floated element should be moved down or not.
Syntax
clear: value;
The value
for the clear
attribute can be:
none
: The element is not moved down to clear past floating elements (the default).left
: The element is moved down to clear past left floated elements.right
: The element is moved down to clear past right floated elements.both
: The element is moved down to clear past both left and right floated elements.
Example 1
Making an img
element move down a left floated h1
element.
.div1 h1 {float: left;}.div1 img {clear: left;}
The image below matches the code example. The h1
element is floated to the left due to float: left
. The img
element is then moved under the h1
element due to clear: left
.
All contributors
- Anonymous contributorAnonymous contributor3071 total contributions
- asiqurr43 total contributions
- KyraThompson73 total contributions
- DanielWiegoldStannard3 total contributions
- christian.dinh2476 total contributions
- Anonymous contributor
- asiqurr
- KyraThompson
- DanielWiegoldStannard
- christian.dinh
Looking to contribute?
- Learn more about how to get involved.
- Edit this page on GitHub to fix an error or make an improvement.
- Submit feedback to let us know how we can improve Docs.