Extensible HyperText Markup Language

XHTML.com recommends: PSD to HTML Slicing Service

float

Definition

The float property is used to float an element to the left or right. Subsequent elements wrap around the floating element. The screen shot below shows an image inserted at the begining of a paragraph without any float settings.

Screen shot of a Web browser with an image rendered on the first line of the paragraph text.

The screen shot below shows shows an image inserted at the begining of a paragraph with the float property set to right.

Screen shot of a Web browser with paragraph text wrapping around a right aligned image.

The screen shot below shows shows an image inserted at the begining of a paragraph with the float property set to left.

Screen shot of a Web browser with paragraph text wrapping around a left aligned image.

Example

  1. img {
  2. float: right;
  3. margin-left: 3px;
  4. }

Characteristics

Possible values

left
Float element to the left.
right
Float element to the right.
none
Do not float element.
inherit
Use the same computed value as the parent element for this property.

Default value

none

Applies to

All elements

Inherited

No

See also