ScanSkill

float

The float property defines which direction an element should float.

Syntax

float: none | left | right;

Example

        .container{
            border: 1px solid red;
            width: 200px;

        }

        .div-1 {
            float: left;
        }

        .div-2 {
            float: none;
        }

        .div-3 {
            float: right;
        }

Property Values

none: element does not float. (default value)

left: element floats towards the left of its container.

right: element floats towards the right of its container.