CSS Float
- The
float
property in CSS allows elements to be shifted to the left or right, allowing content to wrap around them. - Historically used for creating layouts, it has evolved with the advent of newer layout methods like Flexbox and Grid.
Basic Usage of the float
Property
The float
property can take two values:
float: left;
: Floats the element to the left, allowing content to flow around its right side.float: right;
: Floats the element to the right, allowing content to flow around its left side.