What is the purpose of float property in CSS?

The float property is used for positioning the HTML elements horizontally either towards the left or right of the container. For instance,

float-demo {
     float: right; 

Here, the element to which the class is applied ensures that the element is positioned on the right of the container. If you specify the value of float as left, then the element will be placed on the left side of the container.

Posted by: - Fri, Jun 3, 2022. This article has been viewed 739 times.
Online URL: https://www.articlediary.com/article/what-is-the-purpose-of-float-property-in-css-1072.html

Powered by PHPKB (Knowledge Base Software)