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

float

By Jennifer Kyrnin, About.com

float Description:

The float property defines the side around which other elements will flow around the floated element. The floated element will remain on the float side, while other content flows around it.

float in CSS Versions:

float Syntax:

float: left | right | none | inherit

  • left
    Float the element to the left with content flowing to the right.
  • right
    Float the element to the right with content flowing to the left.
  • none
    Remove any float values, and have content flow as it normally would.
  • inherit
    The element should have the same float setting as the parent.

float Initial Value:

none

float Applies To:

All elements.

float Inheritance:

This property is not inherited.

float Browser Support:

float Examples:

float an image right

<p>
<img src="image.gif" alt="image" style="float: right;" />
The text in this paragraph will flow on the left side of the image.
</p>

float Special Notes:

  • A great way to create a pull-quote style is to float a div or paragraph of text within your document. Be sure to give it a width smaller than the rest of your text.

More float Information:

Return to the Style Library

Explore Web Design / HTML

More from About.com

  1. Home
  2. Computing & Technology
  3. Web Design / HTML
  4. CSS
  5. Style Properties
  6. CSS Style Property: float

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

All rights reserved.