CSS Tutorial

The language for styling web pages.

CSS Float

CSS Float

The CSS float property specifies how an element should float. It is used for wrapping text around images or creating multi-column layouts (though Flexbox/Grid are now preferred).

Float Values:

  • left - Float to the left
  • right - Float to the right
  • none - No float (default)
  • inherit - Inherits from parent

Clearfix: Use overflow: auto or ::after hack on the parent to contain floated children.

Try It Yourself

Edit the code below and click Run to see the result live.

Source Code
Result
Topics