CSS2 » Properties » float

Version: Level 1

Compability: IE4+  N4+

Syntax:
float : left | right | none
none
The none value allows the image to simply appear where it occurs within a text.
right
The right value embeds the image within the text and places the right edge of the image on the right side of the text.
left
The left value embeds the image within the text and places the left edge of the image on the left side of the text.

The float property allows you to determine where an image will appear within a text or element. This property is not inherited.

Image and text elements that appear embedded within a text or another element are called floating elements.

Examples

Code:
img { float: left; }
img { float: right; }
img { float: none; }
Language(s): CSS2
Code:
<img src="/images/guru.gif" style="float: right;">
<img src="/images/guru.gif" style="float: none;">
Output:
Devguru logo Devguru logo
Language(s): CSS2

See Also: