Floating

With CSS float, an element ca be pushed to the left or right, allowing other elements to wrap around it.

Float is often used with images, but it is also useful when working with layouts.

The values for the float property are left, right and none.

Left and right float elements in those directions, respectively. none (the default) ensures that the element will not float.

Below is an example of an image that is floated to the right.


This paragraph has an image that is floated to the right. It is highly recommended to add a margin to images so that the text does not get too close to the image. If you want your text to be easily read, you should always add a few pixels between words and borders, iamges, and other content.

Elements are floated horizontally, meaning that an element can only be floated left or right, not up or down.



This paragraph has an image that is floated to the left. It is highly recommended to add a margin to images so that the text does not get too close to the image. If you want your text to be easily read, you should always add a few pixels between words and borders, iamges, and other content.