Easy Tutorial
❮ Pr Margin Pr Border Bottom Width ❯

CSS float Property

Example

Float an image to the right:


Property Definition and Usage

The float property specifies whether or not an element should float.

Note: Absolutely positioned elements ignore the float property!

Default value: none
Inherited: no
--- ---
Version: CSS1
--- ---
JavaScript syntax: object.style.cssFloat="left"
--- ---

Browser Support

The numbers in the table specify the first browser version that fully supports the property.

Property
float 1.0 4.0 1.0 1.0 7.0

Property Values

Value Description
left The element floats to the left.
right The element floats to the right.
none Default value. The element does not float and appears in its normal position in the text.
inherit Specifies that the value of the float property should be inherited from the parent element.

More Examples

Float the first letter of a paragraph to the left

Create a horizontal menu

Create a tableless homepage


Related Articles

CSS Tutorial: CSS Float

❮ Pr Margin Pr Border Bottom Width ❯