×

Tailwind CSS Align Content

In Tailwind CSS, this class accepts a wide range of values. It's a replacement for the CSS Align Content feature. This class is used to modify the flex-wrap property's behavior. Flex lines are aligned. It's used to describe how the lines inside a flexible container should be aligned. This parameter determines how each flex line within a flexbox is aligned and is only applicable if flex-wrap: wrap is used, i.e. if several lines of flexbox items are present.

Align Content Classes

  1. content-center 
  2. content-start 
  3. content-end 
  4. content-between 
  5. content-around 
  6. content-evenly 

content-center

 This class is used to position lines in the flex container's center.

Syntax:

 <element class="content-center">...</element>

Example:

<!DOCTYPE html>

<head>

    <link href=

"https://unpkg.com/tailwindcss@^1.0/dist/tailwind.min.css"

          rel="stylesheet">

</head>

<body class="text-center">

    <h1 class="text-red-600 text-5xl font-bold">

        Javatpoint

    </h1>

    <b>Align Content Class - Tailwind CSS </b>

    <div id="main" class="ml-24 h-48 w-2/3 flex flex-wrap

                          content-center

                          bg-red-200 border-solid border-4

                          border-red-900">

        <div class="bg-red-900 w-24 h-12">1</div>

        <div class="bg-red-800 w-24 h-12">2</div>

        <div class="bg-red-700 w-24 h-12">3</div>

        <div class="bg-red-600 w-24 h-12">4</div>

        <div class="bg-red-500 w-24 h-12">5</div>

        <div class="bg-red-400 w-24 h-12">6</div>

    </div>

</body>

</html>

Output:

Tailwind CSS Align Content

content-start

 This class is used to place lines at the beginning of the flex container.

Syntax:

<element class="content-start">...</element>

Example:

<!DOCTYPE html>

<head>

    <link href=

"https://unpkg.com/tailwindcss@^1.0/dist/tailwind.min.css"

          rel="stylesheet">

</head>

<body class="text-center">

    <h1 class="text-red-600 text-5xl font-bold">

        Javatpoint

    </h1>

    <b>Align Content Class - Tailwind CSS </b>

    <div id="main" class="ml-24 h-48 w-2/3 flex flex-wrap

                          content-start

                          bg-red-200 border-solid border-4

                          border-red-900">

        <div class="bg-red-900 w-24 h-12">1</div>

        <div class="bg-red-800 w-24 h-12">2</div>

        <div class="bg-red-700 w-24 h-12">3</div>

        <div class="bg-red-600 w-24 h-12">4</div>

        <div class="bg-red-500 w-24 h-12">5</div>

        <div class="bg-red-400 w-24 h-12">6</div>

    </div>

</body>

</html>

Output:

Tailwind CSS Align Content

content-end

 The content-end class is used to place lines at the flex container's end.

Syntax:

<element class="content-end">...</element>

Example:

<!DOCTYPE html>

<head>

    <link href=

"https://unpkg.com/tailwindcss@^1.0/dist/tailwind.min.css"

          rel="stylesheet">

</head>

<body class="text-center">

    <h1 class="text-red-600 text-5xl font-bold">

        Javatpoint

    </h1>

    <b>Align Content Class - Tailwind CSS </b>

    <div id="main" class="ml-24 h-48 w-2/3 flex flex-wrap

                          content-end

                          bg-red-200 border-solid border-4

                          border-red-900">

        <div class="bg-red-900 w-24 h-12">1</div>

        <div class="bg-red-800 w-24 h-12">2</div>

        <div class="bg-red-700 w-24 h-12">3</div>

        <div class="bg-red-600 w-24 h-12">4</div>

        <div class="bg-red-500 w-24 h-12">5</div>

        <div class="bg-red-400 w-24 h-12">6</div>

    </div>

</body>

</html>

Output:

Tailwind CSS Align Content

content-between

This class is used to evenly distribute rows in a container such that each line has the same amount of space.

Syntax:

<element class="content-between">...</element>

Example:

<!DOCTYPE html>

<head>

    <link href=

"https://unpkg.com/tailwindcss@^1.0/dist/tailwind.min.css"

          rel="stylesheet">

</head>

<body class="text-center">

    <h1 class="text-red-600 text-5xl font-bold">

        Javatpoint

    </h1>

    <b>Align Content Class - Tailwind CSS </b>

    <div id="main" class="ml-24 h-48 w-2/3 flex flex-wrap

                          content-between

                          bg-red-200 border-solid border-4

                          border-red-900">

        <div class="bg-red-900 w-24 h-12">1</div>

        <div class="bg-red-800 w-24 h-12">2</div>

        <div class="bg-red-700 w-24 h-12">3</div>

        <div class="bg-red-600 w-24 h-12">4</div>

        <div class="bg-red-500 w-24 h-12">5</div>

        <div class="bg-red-400 w-24 h-12">6</div>

    </div>

</body>

</html>

Output:

Tailwind CSS Align Content

content-around

 This class is used to evenly distribute rows in a container so that each line has the same amount of space around it.

Syntax:

<element class="content-around">...</element>

Example:

<!DOCTYPE html>

<head>

    <link href=

"https://unpkg.com/tailwindcss@^1.0/dist/tailwind.min.css"

          rel="stylesheet">

</head>

<body class="text-center">

    <h1 class="text-red-600 text-5xl font-bold">

        Javatpoint

    </h1>

    <b>Align Content Class - Tailwind CSS </b>

    <div id="main" class="ml-24 h-48 w-2/3 flex flex-wrap

                          content-around

                          bg-red-200 border-solid border-4

                          border-red-900">

        <div class="bg-red-900 w-24 h-12">1</div>

        <div class="bg-red-800 w-24 h-12">2</div>

        <div class="bg-red-700 w-24 h-12">3</div>

        <div class="bg-red-600 w-24 h-12">4</div>

        <div class="bg-red-500 w-24 h-12">5</div>

        <div class="bg-red-400 w-24 h-12">6</div>

    </div>

</body>

</html>

Output:

Tailwind CSS Align Content

content-evenly

This class is used to arrange rows in a container so that there is an equal amount of space around each item, while also accounting for the doubling of space between each item that you would see if you used the content-around class.

Syntax:

 <element class="content-evenly">...</element>

Example:

<!DOCTYPE html>

<head>

    <link href=

"https://unpkg.com/tailwindcss@^1.0/dist/tailwind.min.css"

          rel="stylesheet">

</head>

<body class="text-center">

    <h1 class="text-red-600 text-5xl font-bold">

        Javatpoint

    </h1>

    <b>Align Content Class - Tailwind CSS </b>

    <div id="main" class="ml-24 h-48 w-2/3 flex flex-wrap

                          content-evenly

                          bg-red-200 border-solid border-4

                          border-red-900">

        <div class="bg-red-900 w-24 h-12">1</div>

        <div class="bg-red-800 w-24 h-12">2</div>

        <div class="bg-red-700 w-24 h-12">3</div>

        <div class="bg-red-600 w-24 h-12">4</div>

        <div class="bg-red-500 w-24 h-12">5</div>

        <div class="bg-red-400 w-24 h-12">6</div>

    </div>

</body>

</html>

Output:

Tailwind CSS Align Content

Related Topics

Tailwind CSS Height

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 height property. This class is used...

4 minutes read.

Tailwind CSS Max-Height

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 Max-Height attribute. It is used to...

3 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 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 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 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 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 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 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 Stroke Width

In tailwind CSS, this class takes a large number of values and all of the properties are covered in the form. It is used to specify the width of an...

1 minute 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 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 Fill

The CSS Fill class accepts a lot of value, and all of the properties are covered in class form. It is a presentation attribute that controls how an SVG shape's...

1 minute 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 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 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 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 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 Width

The tailwind CSS width class accepts a large number of values, and all of the properties are covered in class form. It's a replacement for the CSS Width Property. This...

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