×

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 container or within the specified window. The flex items are aligned across the axis. To override the align-items class, use the align-self class.

Align Items Classes

  1. items-start 
  2. items-end 
  3. items-center 
  4. items-baseline 
  5. items-stretch

items-start

 The items will be placed at the start of the container.

Syntax:

 <element class="items-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">

        Tutorial and Example

    </h1>

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

    <div id="main" class="p-2 justify-around ml-32 h-26 w-2/3 flex

                          items-start

                          bg-red-200 border-solid border-4

                          border-red-900">

        <div class="bg-red-900 rounded-lg py-4 w-32">1</div>

        <div class="bg-red-800 rounded-lg py-12 w-32">2</div>

        <div class="bg-red-700 rounded-lg py-8 w-32">3</div>

    </div>

</body>

</html>

Output:

Tailwind CSS Align Items

items-end

Items will be placed at the container's end.

Syntax:

 <element class="items-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">

        Tutorial and Example

    </h1>

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

    <div id="main" class="p-2 justify-around ml-32 h-26 w-2/3 flex

                          items-end

                          bg-red-200 border-solid border-4

                          border-red-900">

        <div class="bg-red-900 rounded-lg py-4 w-32">1</div>

        <div class="bg-red-800 rounded-lg py-12 w-32">2</div>

        <div class="bg-red-700 rounded-lg py-8 w-32">3</div>

    </div>

</body>

</html>

Output:

Tailwind CSS Align Items

items-center

 Items should be placed in the vertical center of the container.

Syntax:

 <element class="items-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">

        Tutorial and Example

    </h1>

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

    <div id="main" class="p-2 justify-around ml-32 h-26 w-2/3 flex

                          items-center

                          bg-red-200 border-solid border-4

                          border-red-900">

        <div class="bg-red-900 rounded-lg py-4 w-32">1</div>

        <div class="bg-red-800 rounded-lg py-12 w-32">2</div>

        <div class="bg-red-700 rounded-lg py-8 w-32">3</div>

    </div>

</body>

</html>

Output:

Tailwind CSS Align Items

items-baseline

 Items will be placed at the container's baseline.

Syntax:

 <element class="items-baseline">...</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">

        Tutorial and Example

    </h1>

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

    <div id="main" class="p-2 justify-around ml-32 h-26 w-2/3 flex

                          items-baseline

                          bg-red-200 border-solid border-4

                          border-red-900">

        <div class="bg-red-900 rounded-lg py-4 w-32">1</div>

        <div class="bg-red-800 rounded-lg py-12 w-32">2</div>

        <div class="bg-red-700 rounded-lg py-8 w-32">3</div>

    </div>

</body>

</html>

Output:

Tailwind CSS Align Items

items-stretch

This is the default value, and it stretches items to fit the container.

Syntax:

<element class="items-stretch">...</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">

        Tutorial and Example

    </h1>

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

    <div id="main" class="p-2 justify-around ml-32 h-26 w-2/3 flex

                          items-stretch

                          bg-red-200 border-solid border-4

                          border-red-900">

        <div class="bg-red-900 rounded-lg py-4 w-32">1</div>

        <div class="bg-red-800 rounded-lg py-12 w-32">2</div>

        <div class="bg-red-700 rounded-lg py-8 w-32">3</div>

    </div>

</body>

</html>

Output:

Tailwind CSS Align Items

Related Topics

Tailwind CSS Place Content

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

5 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 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 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 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 Space Between

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 Space Between property....

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

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