float
Widely availableSince 201597% of users
An older layout property that pushes an element to the left or right, allowing text and other content to wrap around it. Often used for images within articles.
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 float
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
- all elements (no effect if display: none)
- Animation type
- discrete
Quick example
img {
/* Pushes image to the right and lets text wrap around left side */
float: right;
margin-left: 15px;
}Values
leftrightnoneinline-startinline-endfloat 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