The CSS float property states how the element should float. For example, it can specify the position where the element should be placed.
Note: The element can be anything i.e., an image, a paragraph, a button, etc.
The syntax for the float CSS property is:
float: value;
CSS float property can have the following values:
None: There will be no effect on the position of the element i.e., the element will not float.
Right: The element floats to the right of its container
Left: The element floats to the left of its container
Inherit: The element inherits the float value of its parent
The following example displays the image when the float is set to none:
The following example makes the image float to the right of the container:
The following example makes the image float to the left of the container:
Free Resources