clear
Widely availableSince 201597% of users
Specifies whether an element should be moved below any 'floating' elements that come before it. It's the classic way to 'break' out of a float layout and start fresh on a new line.
What's modern
From web-features, MDN's browser data and our snippets, checked dailyHas a modern alternativeIt still works everywhere, as it has since July 2015, and there's a newer way for most uses.
Newer parts of clear
inline-endBaseline Oct 2023, Widely Apr 2026inline-startBaseline Oct 2023, Widely Apr 2026
The modern alternative
Use grid, flexbox or display: flow-root. For layout they need no clearfix, and columns line up on their own.
When the old way is still right: Keep a float when text should wrap around an image. That's what floats were made for.
The CSS audit finds floats and clearfix in your code.Check your CSS →
Quick facts
- Initial value
none- Inherited
- No
- Applies to
- block-level elements
- Animation type
- discrete
Quick example
.footer {
clear: both;
/* forces the footer to sit below all floated sidebars or images */
}Values
noneleftrightbothinline-startinline-endclear browser support
BaselineWidely availableThis feature is well established and works across many devices and browser versions. It has been available across browsers since 2015.Safe to use without fallbacks.
Usage97%of people can use this3% use a browser without it.
Browsers
1+
1+
1+
12+Mobile
18+Android
4+Android
1+iOS