CSS Floats

The float property allows an element to be taken out of the normal document flow and be positioned to the left or right of its container. Common values for float include leftright, and none (default).

Tutorials dojo strip

In this example, .image-left will float to the left, and .image-right will float to the right. The margin is added to create spacing between the floated element and surrounding content.

CSS

Clearing Floats

When elements are floated, the following content can wrap around them. The clear property is used to prevent this, ensuring that the next element moves below the floated elements.

CSS

CSS Floats Example Code

HTML

CSS Labs

Tutorials dojo strip