XML technologies / CSS / Advanced websites with CSS / CSS property reference / float

(Excerpt from “CSS − Advanced websites with Cascading Stylesheets” by Rachel Andrew & Dan Shafer)

The property float allows a neighbouring element to flow around an element at the right or left edge of its parent. If a block element follows a floating element, the float does not affect the block’s position on the page; only its content flows around the float. Elements assigned the CSS property clear cannot flow around floating elements.

Inherited: no

See also: clear

Values

left, right or none.

Default value: none

Compatibility

CSS version: 1

Works in all CSS-capable browsers, including Netscape 4, Internet Explorer 4 and Mozilla.

Example

The following rule makes images of the class textbild float at the left side of their parent element, with subsequent elements flowing around them:

img.textbild {
 float: left;
}

  

 

 

 

back to top