B.36. float

When set to a value besides the default (none), this property causes the element to float against the left or right margin of its parent element. A floated element will not affect the placement of any of the blocks on the page, but the content within those blocks (including other floated elements) will flow around it. The clear property lets you create elements that will be displaced downwards to prevent their content from flowing around floated elements.

Inherited: No

See also: Section B.22clear

B.36.1. Value

left, right, or none.

Initial value: none

B.36.2. Compatibility

CSS Version: 1

Supported by all CSS-compatible browsers, including Netscape 4, Internet Explorer 4, and Mozilla browsers.

B.36.3. Example

This style rule sets ...

Get HTML Utopia: Designing Without Tables Using CSS now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.