The float property places an element on the left or right of its container so following text and inline content can wrap around it.
Floated elements leave normal flow for placement, but text still wraps beside them. For page grids, prefer Flexbox or Grid. Use float mainly for wrapping text around images — and use clear or display: flow-root when you need to contain floats.
Baseline · Widely available.
Not deprecated and not experimental. left, right, and none work everywhere. Logical values inline-start and inline-end need newer browsers.
Syntax
CSS Syntax
syntax.css
float:none | left | right | inline-start | inline-end | initial | inherit;
The initial value is none. The property is not inherited.
With float: none, the box is a normal block above the text.
How It Works
Default behavior.float: none means no floating.
Block stacking. The box and paragraph sit one under the other.
No side wrap. Text does not sit beside the box.
Compare with left/right. The earlier examples show the wrapping difference.
Edge Cases & Pitfalls
If wrapping or height looks wrong, check these first.
parent
Parents can collapse around floats
A parent that only contains floats may shrink to zero height. Use display: flow-root (or another BFC) on the parent.
clear
Stop wrapping with clear
A following heading or footer that must sit fully below the float needs clear: both (or left/right).
layout
Prefer Flex/Grid for page structure
Floats are awkward for multi-column page shells. Use Flexbox or Grid for those; keep float for text wrapping.
width
Give floated boxes a width
Without a width, a floated box can shrink to its content in ways that surprise beginners. Set an explicit width for demos and images.
logical
inline-start follows direction
In LTR, inline-start matches left. In RTL it matches right. Prefer logical values when direction varies.
Compatibility
Browser Support
float is a browser CSS property for wrapping layout. Node.js, Deno, and Bun do not apply it.
✓ Baseline · Widely available
float
Classic left / right / none work in all major browsers, including Internet Explorer. Logical inline-start / inline-end: Chrome 118+, Firefox 55+, Safari 15+.
99%Classic value support
Google Chrome1+
Full support
Mozilla Firefox1+
Full support
Apple Safari1+
Full support
Microsoft Edge12+
Full support
Opera7+
Full support
Samsung Internet1+
Full support
Internet Explorer4+
Full support (classic values)
float (none / left / right)Universally supported
Bottom line: Safe everywhere for left, right, and none. Use inline-start / inline-end when you can require modern browsers. It is not a runtime API.
Remember
Key Takeaways
Role: dock a box left or right so text wraps around it.
Best use: images beside paragraphs — not full page grids.
Contain or clear:flow-root on parents; clear on later blocks.
Initial value:none. Not inherited.
One line: sized box + float: left; + following text = classic wrap-around layout.
Frequently Asked Questions
It moves an element to the left or right of its container so following text and inline content can wrap around it. The element leaves normal flow but still affects layout around it.
The initial value is none. The element stays in normal flow and nothing wraps beside it because of float.
Absolute positioning removes an element from flow completely. A float is taken out of normal flow for placement, but text still wraps around it and it still influences the layout.
Use clear on a following element (often clear: both), or give the parent display: flow-root so it grows around floated children.
For new full-page layouts, prefer Flexbox or Grid. float remains useful for wrapping text around images and for older float-based code.
It is Baseline Widely available. Classic left, right, and none work in all major browsers, including Internet Explorer. Logical inline-start and inline-end need newer browsers. It is a browser CSS property, not a Node.js feature.