×

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

This class accepts a lot of value, and all of the properties are covered in class form. We can change the opacity of any element by using this class. The...

1 minute read.

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

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

CSS flexbox is an important element for frontend development. CSS has four directions, therefore in tailwind CSS, all of the properties are covered in class form. It's a front-end development...

5 minutes read.