×

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

One of the best features of Tailwind CSS is the Order class, which allows us to order flex and grid objects according to our needs. There are several different order...

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

CSS flexbox is an important component for frontend development. There are four flex options in Tailwind CSS, and all of the attributes are covered in class form. It's a front-end...

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