CSS Float Property

The CSS float property, is used to float an element towards the left or right.

Floated elements automatically becomes blocks, so you do not need to declare them as blocks using the CSS display property.

The float property is commonly used to create multi-column layouts, but absolute positioning can also be used.

Sometimes you may want to have elements placed below some floated elements, in which case you need to clear the floats first. Either using an anonymous div, or on the elements themselves.

Possible Values

  1. left
  2. right
  3. none - (Default)

CSS Float Example

#LeftContent {
 float: left;
 min-height: 200px;
 width: 50%;
}
#RightContent {
 float: right;
 min-height: 200px;
 width: 49%;
}
#Footer {
  min-height: 100px;
  clear: both;
}

Inherited? - NO!

Post comment

Links that you insert are not nofollowed, but will be removed by admins if they are considered spam.

[url=Absolute URL for page]TITLE[/url]

You should insert code boxes around code examples, which will be automatically syntax highlighted.

[code1 html|css|javascript|php|sql]Your Code Here[/code1]

You may want to read our Privacy Policy before submitting your comment.