Float CSS Property

Posted By: Kanika Gupta Published: 14, Jan 2024

Float CSS Property


Float is yet another important property of CSS used for specifying the position of contents of a webpage. As the name suggests, floating an element means moving an element to the desired position while allowing other elements to wrap around it.

This property is most commonly used to wrap text around images or any inline elements including paragraph, list, button or table.

Values of float property

The most common parameters/values used for this property are

  • Left
  • Right
  • None
  • Initial

Syntax

float: value;

  1. float: left
  2. This property is used to position elements on the left side of the webpage.

    Example:

    Output:

  3. float: right
  4. This property is used to position elements on the left side of the webpage.

    Example:

    Output:


  5. float: none
  6. This property is used to set the floating property of an element to none. The element will not float and will be displayed according to the default value i.e. from left to right.

    Example:


    Output:


  7. float: initial
  8. This property is used to position an element to its initial value.

    Example:

    The element is at first floated to right.


    Output:


    The element is now floated to its initial value – left.


    Output:



contact us

Get Free Professional Consultation

Corporate Address

4, 2nd Floor, B41, Block B, Sector 2, Noida, 201301, Uttar Pradesh, India, Noida, India, Uttar Pradesh


Sultanur, Delhi 110030


Registered Address

Dinesh Vihar Meerut, 250002

Mon - Sat (9AM to 7PM)


Get in Touch

Let’s Discuss Your Project in Details


Let’s explore your project in detail, focusing on key elements like goals, audience, features, and timelines to set you up for success.