×

Tailwind CSS Float

The float class acknowledges more than one worth (value) in tailwind CSS. It is an option in contrast to the CSS float property. The float class characterizes the progression of content for controlling the wrapping of content around an element.

Float Classes

There are three types of float classes, which are as follows:

  • float-right
  • float-left
  • float-none
  1. float-right

This class is utilized to make the element float on the right half (right-side) of the container.

Syntax:

<element class="float-right">...</element>

Example:

Code is as follows:

<!DOCTYPE html> 
<head> 
<link href=
"https://unpkg.com/tailwindcss@^1.0/dist/tailwind.min.css" 
rel="stylesheet"> 
</head> 
<body class="text-center"> 
<center>
<h1 class="text-red-600 text-5xl font-bold">
Tutorial and Example
</h1> 
<b>float Class - Tailwind CSS </b> 
<div class="mx-10">
<img class="float-right p-2" 
src=
“javatpoint logo_image.png">
<p class="text-justify ">How often were you disappointed while watching out
for a decent assortment of programming/calculation/interview
questions ? What did you expect and what did you get?
This entry has been made to give elegantly composed,
all around thought and very much clarified answers for chose
questions. An IIT Roorkee former student and originator of
Javatpoint. He loves to take care of programming issues
in most productive ways. Aside from Javatpoint, he
has worked with DE Shaw and Co. as a product designer
what's more JIIT Noida as an associate professor.It is a decent
stage to pick up programming. It is an instructive
site. Get ready for the Recruitment drive of item
based organizations like Microsoft, Amazon, Adobe and so on with
a free internet based arrangement readiness course. </p>
</center>
</body> 
</html>

The output for the above code is:

Tailwind CSS Float

In the above output, the image which is circled is following the float right command.

  1. float-left

This class is utilized to make the element float on the left half (side) of the container.

Syntax:

<element class="float-left"">...</element>

Example:

Code is as follows:

<!DOCTYPE html> 
<head> 
<link href=
"https://unpkg.com/tailwindcss@^1.0/dist/tailwind.min.css" 
rel="stylesheet"> 
</head> 
<body class="text-center"> 
<center>
<h1 class="text-red-600 text-5xl font-bold">
Tutorial and Example
</h1> 
<b>float Class - Tailwind CSS </b> 
<div class="mx-10">
<img class="float-left p-2" 
src=
"javatpoint logo_image.png">
<p class="text-justify ">How often were you disappointed while watching out
for a decent assortment of programming/calculation/interview
questions? What did you expect and what did you get?
This entry has been made to give elegantly composed,
all around thought and very much clarified answers for chose
questions. An IIT Roorkee former student and originator of
Javatpoint. He loves to take care of programming issues
in most productive ways. Aside from Javatpoint, he
has worked with DE Shaw and Co. as a product designer
what's more JIIT Noida as an associate professor.It is a decent
stage to pick up programming. It is an instructive
site. Get ready for the Recruitment drive of item
based organizations like Microsoft, Amazon, Adobe and so on with
a free internet based arrangement readiness course.</p>
</center>
</body> 
</html>

The output for the above code is:

Tailwind CSS Float

In the above output, the image which is (at left corner) circled is following the float left command.

  1. float-none

This class is utilized to make the element float at the default place. We are utilizing the center tag so the picture is put in the middle (center).

Syntax:

<element class="float-none"">...</element>

Example:

Code is as follows:

<!DOCTYPE html> 
<head> 
<link href=
"https://unpkg.com/tailwindcss@^1.0/dist/tailwind.min.css" 
rel="stylesheet"> 
</head> 
<body class="text-center"> 
<center>
<h1 class="text-red-600 text-5xl font-bold">
Tutorial and Example
</h1> 
<b>float Class - Tailwind CSS </b> 
<div class="mx-10">
<img class="float-none p-2" 
src=
"javatpoint logo_image.png">
<p class="text-justify ">How often were you disappointed while watching out
for a decent assortment of programming/calculation/interview
questions? What did you expect and what did you get?
This entry has been made to give elegantly composed,
all around thought and very much clarified answers for chose
questions. An IIT Roorkee former student and originator of
Javatpoint. He loves to take care of programming issues
in most productive ways. Aside from Javatpoint, he
has worked with DE Shaw and Co. as a product designer
what's more JIIT Noida as an associate professor.It is a decent
stage to pick up programming. It is an instructive
site. Get ready for the Recruitment drive of item
based organizations like Microsoft, Amazon, Adobe and so on with
a free internet based arrangement readiness course.</p>
</center>
</body> 
</html>

The output for the above code is:

Tailwind CSS Float

In the above output, the image which is circled (at left corner) is following the float none command.


Related Topics

Tailwind CSS Clear

This class acknowledges more than one worth in tailwind CSS. Every one of the properties is canvassed as in class form. It is an option in contrast to the CSS...

5 minutes read.

Tailwind CSS Grid Template Columns

In tailwind CSS, this class accepts multiple values, and all of the properties are covered in class form. It's the CSS grid-template-columns property's replacement. It's used to specify the number...

2 minutes read.

Tailwind CSS Visibility

In tailwind CSS, this class accepts two values. It's a replacement for the CSS visibility property. This class specifies whether an element in a web document is visible or not,...

2 minutes read.

Tailwind CSS Grid Template Rows

In tailwind CSS, this class accepts multiple values and all properties are covered in class form. It's the CSS grid-template-row property's replacement. It is used to set the number of...

2 minutes read.

Tailwind CSS Z-index

The tailwind CSS framework is a CSS utility framework that provides classes for managing HTML content with CSS. Tailwind CSS simplifies our design process and makes it responsive across numerous...

4 minutes read.

Tailwind CSS Margin

The margin class accepts a large number of values, and all of the properties are covered in the same way they are in the class form. It's a replacement for...

6 minutes read.

Tailwind CSS Grid Auto Rows

In tailwind CSS, this class takes multiple values and covers all of the properties in class form. It's a replacement for the grid-auto-rows CSS attribute. The size of the rows...

6 minutes read.

Tailwind CSS Installation

Here, we will discuss the installation method of Tailwind CSS using two strategies discussed as follows: Strategy 1: Install Tailwind through npm Step 1: npm init - y Step 2: npm install tailwindcss Step...

2 minutes read.

Tailwind CSS Flex Shrink

CSS flexbox is an important element for frontend development. There are two flex-shrink options in Tailwind CSS, and all properties are covered in class form. For quick front-end development, it's...

3 minutes read.

Tailwind CSS Justify Self

The class form goes over the various properties. It's a replacement for the CSS justify-self attribute. This class is used to describe the alignment of content’s position in a CSS...

4 minutes read.

Tailwind CSS Flex Direction

CSS flexbox is an important element for frontend development. CSS has four directions, therefore in tailwind CSS, all of the properties are covered in class form. It's a front-end development...

5 minutes read.

Tailwind CSS Align Self

This class accepts a wide range of values. It's a replacement for the CSS Align Self attribute. This class is used to control how a flex or grid item is...

4 minutes read.

Tailwind CSS Gap

In tailwind CSS, this class accepts multiple values, and all of the properties are covered in class form. It's a replacement for the CSS gap attribute. This class is used...

4 minutes read.

Tailwind CSS Align Items

In tailwind CSS, this class accepts a wide range of values. It's a replacement for the CSS Align Items attribute. This class is used to align things within the flexible...

5 minutes read.

Tailwind CSS Justify Items

It is a replacement for the CSS justify-items attribute. This class is used to regulate the alignment of grid objects along their inline axis. Justify Item It is classified as: justify-items-auto justify-items-start justify-items-end justify-items-center justify-items-stretch justify-items-auto The justify-items-auto class...

4 minutes read.

Tailwind CSS Stroke

This class accepts a lot of value, and all of the properties are covered in class form. It's the stroke class that goes on top of the SVG element. Stroke...

2 minutes read.

Tailwind CSS Flex Grow

CSS flexbox is an important element for frontend development; there are two flex-grow options in Tailwind CSS, and all attributes are covered in class form. It is an alternative to...

3 minutes read.

Tailwind CSS Float

The float class acknowledges more than one worth (value) in tailwind CSS. It is an option in contrast to the CSS float property. The float class characterizes the progression of...

4 minutes read.

Tailwind CSS Display

It acknowledges more than one worth in tailwind CSS. Every one of the properties is shrouded as in class structure. It is an option in contrast to the CSS display...

5 minutes read.

Tailwind CSS Overflow

The overflow class acknowledges more than one value in Tailwind CSS. It is an option in contrast to the CSS Overflow property. This overflow is for controlling how element content...

9 minutes read.