×

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 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 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 Box Shadow

The Tailwind CSS Box Shadow class accepts a lot of value, and all of the properties are covered in class form. We may control the box-shadow of an element by...

2 minutes read.

Tailwind CSS Top / Right / Bottom / Left

In tailwind CSS, these classes take a variety of values and cover all of the characteristics in the class form. These are the CSS Top/Right/Bottom/Left properties' replacements. These classes are...

4 minutes read.

Tailwind CSS Place Items

This class accepts a wide range of values. It's a replacement for the CSS Place Items property. This class is used to manage how things are justified while still being...

4 minutes read.

Tailwind CSS Max-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 max-width property. This...

3 minutes read.

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 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 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 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 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 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 Flow

In tailwind CSS, this class accepts multiple values, and all of the properties are covered in class form. It is a CSS alternative. The grid-auto-flow property is used in Tailwind...

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

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