Definitions and Usage
The float property defines in which direction the element floats. Historically this attribute is always applied to images, making text around the image, but in CSS, any element can float. A floating element generates a block-level box, regardless of what element it is itself.
If you float a replacement element, you specify a clear width; otherwise, they are as narrow as possible.
Note: If there is only a small amount of space on a line for floating elements, the element jumps to the next line, which lasts until a row has enough space.
Default value:
None |
Inheritance:
No |
Version:
CSS1 |
JavaScript Syntax:
Object.style.cssfloat= "left" |
instance
To float the image to the right:
IMG { float:right; }
Tiy
Browser Support
The float property is supported by all major browsers.
Note: The property value "Inherit" is not supported for any version of Internet Explorer (including IE8).
Possible values
Value Description
elements float to the left. The |
right |
element floats to the right. |
none |
default value. The element does not float and is displayed where it appears in the text. |
inherit |
|