CSS float Property


The float CSS property is used to position elements to the left and right of their container, as well as to allow text and inline elements to wrap around it. The float property defines the page's content flow. If an element is removed from the normal flow of the content, the remaining elements will be included in the flow. The elements that are absolutely positioned ignore this property. It can be written in a CSS file or directly specified in an element's style.

Syntax

Example

Preview

Property Values

Value Description
none The element is not floatable. This is the default setting.
left The element appears to float to the left of its container.
right The element is positioned to the right of its container.
initial This property is set to its default value.
inherit This property is inherited from its parent element.

Supported Browsers

Element Chrome Firefox Safari Edge / IE Opera
float 1.0 1.0 1.0 4.0 7.0