×

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 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 Place Self

The tailwind CSS Place self class accepts a wide range of values. It's a replacement for the CSS Place Items property. This class is used to manage how a single...

4 minutes read.

Tailwind CSS Box Sizing

Tailwind CSS Box sizing class acknowledges more than one worth in tailwind CSS. Each property is shrouded as a class structure. It is an option in contrast to the CSS...

2 minutes read.

Tailwind CSS Grid Row Start / End

In tailwind CSS, this class takes several values. All of the attributes are covered in the form of a class. In CSS, it's an alternative to the grid-row attribute. It's...

4 minutes read.

Tailwind CSS Grid Column Start / End

This class accepts multiple values, and all of the properties are covered in class form. It was used as a replacement to the CSS grid-column property in CSS to express...

3 minutes read.

Tailwind CSS Flex Wrap

CSS flexbox is an important component for frontend development. It is a front-end development alternative to the CSS flex-wrap Property. Note: You must include the flex class in your element before...

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 Justify Content

In tailwind CSS, this class accepts two values. It's a replacement for CSS's justify-content attribute. This class is used to describe the flexible box container's alignment. Along the main axis...

4 minutes read.

Tailwind CSS Min-Height

In tailwind CSS, this class accepts a large number of values, and all of the properties are covered in class form. It's a replacement for the CSS Min-Height Property. It...

2 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 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 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.

Tailwind CSS Padding

This class accepts a large number of values, and all of the properties are covered in class form. It's a replacement for the CSS Padding Property. This class is used...

4 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 Object Position

It acknowledges more than one value in tailwind CSS. Every one of the properties is covered as in class form. It is the option in contrast to the CSS object-position...

2 minutes read.

Tailwind CSS Position

The position class acknowledges more than one value in tailwind CSS. It is an option in contrast to the CSS Position property. This class is utilized for controlling how an...

5 minutes read.

Tailwind CSS Grid Auto Columns

The Grid Auto Columns class accepts multiple values, and all of the properties are covered in class form. It's a replacement for the CSS grid-auto-columns property. The size of the...

5 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 Min-Width

In tailwind CSS, this class accepts a large number of values, and all of the properties are covered in class form. It's a replacement for the CSS min-width property. This...

1 minute read.

Tailwind CSS Object Fit

It acknowledges more than one value in tailwind CSS. Every one of its properties is covered as in class form. It is the option in contrast to the CSS object-fit...

4 minutes read.