×

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 aligned. As a result, the align-items and justify-items classes' values can be stored in the place-items class.

Place Items Classes

  • place-items-auto
  • place-items-start
  • place-items-end
  • place-items-center
  • place-items-stretch

place-items-auto

If there are no parents for the objects, this class is used to describe the absolute positioning.

Syntax:

<element class="place-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">
        Tutorial and Example
    </h1>
    <b>Place Items Class - Tailwind CSS </b>
    <div id="main" class="ml-24 h-48 w-2/3 grid grid-cols-3 gap-2
                          place-items-auto
                          h-48 bg-red-200 border-solid border-4
                          border-red-900">
        <div class="bg-red-900 w-3/4 h-12">1</div>
        <div class="bg-red-800 w-3/4 h-12">2</div>
        <div class="bg-red-700 w-3/4 h-12">3</div>
        <div class="bg-red-600 w-3/4 h-12">4</div>
        <div class="bg-red-500 w-3/4 h-12">5</div>
        <div class="bg-red-400 w-3/4 h-12">6</div>
    </div>
</body>
</html>

Output:

Tailwind CSS Place Items

place-items-start

The lines at the beginning of the flex container are displayed by this class.

Syntax:

<element class="place-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>Place Items Class - Tailwind CSS </b>
    <div id="main" class="ml-24 h-48 w-2/3 grid grid-cols-3 gap-2
                          place-items-start
                          h-48 bg-red-200 border-solid border-4
                          border-red-900">
        <div class="bg-red-900 w-3/4 h-12">1</div>
        <div class="bg-red-800 w-3/4 h-12">2</div>
        <div class="bg-red-700 w-3/4 h-12">3</div>
        <div class="bg-red-600 w-3/4 h-12">4</div>
        <div class="bg-red-500 w-3/4 h-12">5</div>
        <div class="bg-red-400 w-3/4 h-12">6</div>
    </div>
</body>
</html>

Output:

Tailwind CSS Place Items

place-items-end

The flex lines at the end of the flex container are displayed by this class.

Syntax:

<element class="place-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>Place Items Class - Tailwind CSS </b>
    <div id="main" class="ml-24 h-48 w-2/3 grid grid-cols-3 gap-2
                          place-items-end
                          h-48 bg-red-200 border-solid border-4
                          border-red-900">
        <div class="bg-red-900 w-3/4 h-12">1</div>
        <div class="bg-red-800 w-3/4 h-12">2</div>
        <div class="bg-red-700 w-3/4 h-12">3</div>
        <div class="bg-red-600 w-3/4 h-12">4</div>
        <div class="bg-red-500 w-3/4 h-12">5</div>
        <div class="bg-red-400 w-3/4 h-12">6</div>
    </div>
</body>
</html>

Output:

Tailwind CSS Place Items

place-items-center

This class places flex objects in the container's center.

Syntax:

<element class="place-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>Place Items Class - Tailwind CSS </b>
    <div id="main" class="ml-24 h-48 w-2/3 grid grid-cols-3 gap-2
                          place-items-center
                          h-48 bg-red-200 border-solid border-4
                          border-red-900">
        <div class="bg-red-900 w-3/4 h-12">1</div>
        <div class="bg-red-800 w-3/4 h-12">2</div>
        <div class="bg-red-700 w-3/4 h-12">3</div>
        <div class="bg-red-600 w-3/4 h-12">4</div>
        <div class="bg-red-500 w-3/4 h-12">5</div>
        <div class="bg-red-400 w-3/4 h-12">6</div>
    </div>
</body>
</html>

Output:

Tailwind CSS Place Items

place-items-stretch

This class specifies that the line is stretched to fill the flex container's remaining space. It's the default setting.

Syntax:

<element class="place-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>Place Items Class - Tailwind CSS </b>
    <div id="main" class="ml-24 h-48 w-2/3 grid grid-cols-3 gap-2
                          place-items-stretch
                          h-48 bg-red-200 border-solid border-4
                          border-red-900">
        <div class="bg-red-900 w-3/4">1</div>
        <div class="bg-red-800 w-3/4">2</div>
        <div class="bg-red-700 w-3/4">3</div>
        <div class="bg-red-600 w-3/4">4</div>
        <div class="bg-red-500 w-3/4">5</div>
        <div class="bg-red-400 w-3/4">6</div>
    </div>
</body>
</html>

Output:

Tailwind CSS Place Items

Related Topics

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

The float class acknowledges more than one worth (value) in tailwind CSS. It is an option in contrast to the CSS float property. The float class characterizes the progression of...

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

Tailwind CSS can be utilized to make sites in the quickest and the least demanding way. Tailwind CSS is the most famous utility-first CSS structure on the planet for quickly...

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