Advertisement

Google Ad Slot: content-top

CSS Float


In CSS, the float property is used to position an element to the left or right of its container, allowing other inline elements (such as text) to wrap around it. This property was more commonly used in older layouts but has since been largely replaced by newer layout techniques like Flexbox and Grid.


Syntax:

float: left | right | none | inherit;
Example
.img1 {
float: right;
}
.img2 {
float: left;
}
Try it yourself