×

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 is used to automatically justify grid items on their inline axis.

Syntax:

<element class="justify-items-auto">...</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>Justify Items Class - Tailwind CSS </b> 
    <div id="main" class="grid justify-items-auto grid-cols-2"> 
        <div class="bg-red-500 rounded-lg m-4 h-12">1</div> 
        <div class="bg-red-500 rounded-lg m-4 h-12">2</div> 
        <div class="bg-red-500 rounded-lg m-4 h-12">3</div> 
        <div class="bg-red-500 rounded-lg m-4 h-12">4</div>
        <div class="bg-red-500 rounded-lg m-4 h-12">5</div> 
        <div class="bg-red-500 rounded-lg m-4 h-12">6</div>
    </div> 
</body> 
</html>

Output:

Tailwind CSS Justify Items

justify-items-start

 This class is used to justify grid items against the inline axis's start.

Syntax:

<element class="justify-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">
        Javatpoint
    </h1> 
    <b>Justify Items Class - Tailwind CSS </b> 
    <div id="main" class="grid justify-items-start grid-cols-2"> 
        <div class="bg-red-500 rounded-lg m-4 h-12">1</div> 
        <div class="bg-red-500 rounded-lg m-4 h-12">2</div> 
        <div class="bg-red-500 rounded-lg m-4 h-12">3</div> 
        <div class="bg-red-500 rounded-lg m-4 h-12">4</div>
        <div class="bg-red-500 rounded-lg m-4 h-12">5</div> 
        <div class="bg-red-500 rounded-lg m-4 h-12">6</div>
    </div> 
</body> 
</html>

Output:

Tailwind CSS Justify Items

justify-items-end

Justify grid components against the end of their inline axis with this class.

Syntax:

<element class="justify-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">
        Javatpoint
    </h1> 
    <b>Justify Items Class - Tailwind CSS </b> 
    <div id="main" class="grid justify-items-end grid-cols-2"> 
        <div class="bg-red-500 rounded-lg m-4 h-12">1</div> 
        <div class="bg-red-500 rounded-lg m-4 h-12">2</div> 
        <div class="bg-red-500 rounded-lg m-4 h-12">3</div> 
        <div class="bg-red-500 rounded-lg m-4 h-12">4</div>
        <div class="bg-red-500 rounded-lg m-4 h-12">5</div> 
        <div class="bg-red-500 rounded-lg m-4 h-12">6</div>
    </div> 
</body> 
  
</html>

Output:

Tailwind CSS Justify Items

justify-items-center

Grid elements are justified along their inline axis with this class.

Syntax:

<element class="justify-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">
        Javatpoint
    </h1> 
    <b>Justify Items Class - Tailwind CSS </b> 
    <div id="main" class="grid justify-items-center grid-cols-2"> 
        <div class="bg-red-500 rounded-lg m-4 h-12">1</div> 
        <div class="bg-red-500 rounded-lg m-4 h-12">2</div> 
        <div class="bg-red-500 rounded-lg m-4 h-12">3</div> 
        <div class="bg-red-500 rounded-lg m-4 h-12">4</div>
        <div class="bg-red-500 rounded-lg m-4 h-12">5</div> 
        <div class="bg-red-500 rounded-lg m-4 h-12">6</div>
    </div> 
</body> 
  
</html>

Output:

Tailwind CSS Justify Items

justify-items-stretch

 The justify-items-stretch class is used to stretch items along their inline axis.

Syntax:

<element class="justify-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">
        Javatpoint
    </h1> 
    <b>Justify Items Class - Tailwind CSS </b> 
    <div id="main" class="grid justify-items-stretch grid-cols-2"> 
        <div class="bg-red-500 rounded-lg m-4 h-12">1</div> 
        <div class="bg-red-500 rounded-lg m-4 h-12">2</div> 
        <div class="bg-red-500 rounded-lg m-4 h-12">3</div> 
        <div class="bg-red-500 rounded-lg m-4 h-12">4</div>
        <div class="bg-red-500 rounded-lg m-4 h-12">5</div> 
        <div class="bg-red-500 rounded-lg m-4 h-12">6</div>
    </div> 
</body> 
  
</html>

Output:

Tailwind CSS Justify Items

Related Topics

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

CSS flexbox is an important element for frontend development. There are two flex-shrink options in Tailwind CSS, and all properties are covered in class form. For quick front-end development, it's...

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

In Tailwind CSS, a compartment is utilized to fix the maximum width (max-width) of a component to match the min-width of the breakpoint. It comes exceptionally convenient when content must...

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

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