- Home
- /
- CSS Float
CSS Tutorial
Introduction
CSS Properties
CSS Designing
CSS Advance Topics
CSS FAQs
- Home
- /
- CSS Float
CSS Float
The float
property allows elements (like images or boxes) to move to the left or right of their container, allowing surrounding content (like text) to wrap around them — just like how text wraps around images in Microsoft Word.
Without Float
When no float is applied, the image stays in its natural block position, and text appears below it.
Image without Float
This paragraph appears below the image because no float is applied. The image takes up the full width of its line, pushing the text underneath.

Float Right
When we apply float: right
, the image moves to the right, and the text wraps around it on the left side.
Float Right
This image is floated to the right. The text flows on the left side, wrapping nicely around the image. This is helpful for articles, blogs, or product descriptions.

Float Left
Similarly, you can float the image to the left, and text will wrap around it on the right side.
Float Left
This image is floated to the left. Text now wraps on the right side. You often see this style in magazines, news layouts, and blogs.

Clearing Float
Sometimes, floated elements can break the layout of other elements. Use clear
to prevent overlap or layout issues.
Float with Clearfix
This text wraps around the floated image.
This paragraph appears below the floated image because we cleared the float using the 'clear' property.
