1. Home
  2. Computing & Technology
  3. Web Design / HTML

Using the CSS Property: Float

Use the CSS property float to align block-level elements within the flow of the Web page. Inline elements will flow around floated elements.

See floats in action

Float an Element Left

 

Float an Element Right

 

An Image Floated to the Left

Suni Duis aute irure dolor sed do eiusmod tempor incididunt in reprehenderit in voluptate. Cupidatat non proident, ut labore et dolore magna aliqua. Sunt in culpa quis nostrud exercitation excepteur sint occaecat. Mollit anim id est laborum.

How to Float an Image to the Left of Text

An Image Floated to the Right

Suni Duis aute irure dolor sed do eiusmod tempor incididunt in reprehenderit in voluptate. Cupidatat non proident, ut labore et dolore magna aliqua. Sunt in culpa quis nostrud exercitation excepteur sint occaecat. Mollit anim id est laborum.

How to Float an Image to the Right of Text

An Image Without Any Float Styling

Suni Duis aute irure dolor sed do eiusmod tempor incididunt in reprehenderit in voluptate. Cupidatat non proident, ut labore et dolore magna aliqua. Sunt in culpa quis nostrud exercitation excepteur sint occaecat. Mollit anim id est laborum.

Nested Floats

 

Multiple Floats

 
 
 

Clearing Floats

Suni Duis aute irure dolor sed do eiusmod tempor incididunt in reprehenderit in voluptate.

This text is still floated.

This text has been cleared to the right. Any elements that follow this text will not display to the left of the image.

Jennifer Kyrnin

Explore Web Design / HTML

More from About.com

  1. Home
  2. Computing & Technology
  3. Web Design / HTML
  4. About.com Web Design A to Z
  5. Examples
  6. Using the CSS Property: Float

©2008 About.com, a part of The New York Times Company.

All rights reserved.