×

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 aligned. To change the values of several properties in a single class, the align-content and justify-content class values can be stored in the place-content class.

Place Content Classes

The classes are as follows:

  • place-content-center
  • place-content-start
  • place-content-end
  • place-content-between
  • place-content-around
  • place-content-evenly
  • place-content-stretch

place-content-center

The place-content-center class aligns flex elements in the container's centre.

Syntax:

<element class="place-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">
        Tutorial and Example
    </h1>
    <b>Place Content Class - Tailwind CSS </b>
    <div id="main" class="ml-24 h-48 w-2/3 grid grid-cols-3 gap-2
                          place-content-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 Content

place-content-start

The place-content-start class aligns flex items at the container's start.

Syntax:

<element class="place-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">
       Tutorial and Example
    </h1>
    <b>Place Content Class - Tailwind CSS </b>
    <div id="main" class="ml-24 h-48 w-2/3 grid grid-cols-3 gap-2
                          place-content-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 Content

place-content-end

The place-content-end class aligns flex items at the container's end.

Syntax:

<element class="place-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">
       Tutorial and Example
    </h1>
    <b>Place Content Class - Tailwind CSS </b>
    <div id="main" class="ml-24 h-48 w-2/3 grid grid-cols-3 gap-2
                          place-content-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 Content

place-content-between

This class spreads the space between flex lines evenly.

Syntax:

<element class="place-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">
       Tutorial and Example
    </h1>
    <b>Place Content Class - Tailwind CSS </b>
    <div id="main" class="ml-24 h-48 w-2/3 grid grid-cols-3 gap-2
                          place-content-between
                          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 Content

place-content-around

The place-content-around class evenly distributes space around the flex lines.

Syntax:

<element class="place-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">
       Tutorial and Example
    </h1>
    <b>Place Content Class - Tailwind CSS </b>
    <div id="main" class="ml-24 h-48 w-2/3 grid grid-cols-3 gap-2
                          place-content-around
                          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 Content

place-content-evenly

This class specifies a position with equal spacing between them, but with different spacing from the corners.

Syntax:

<element class="place-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">
       Tutorial and Example
    </h1>
    <b>Place Content Class - Tailwind CSS </b>
    <div id="main" class="ml-24 h-48 w-2/3 grid grid-cols-3 gap-2
                          place-content-evenly
                          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 Content

place-content-stretch

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

Syntax:

<element class="place-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">
       Tutorial and Example
    </h1>
    <b>Place Content Class - Tailwind CSS </b>
    <div id="main" class="ml-24 h-48 w-2/3 grid grid-cols-3 gap-2
                          place-content-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 Content

Related Topics

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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 Grid Auto Rows

In tailwind CSS, this class takes multiple values and covers all of the properties in class form. It's a replacement for the grid-auto-rows CSS attribute. The size of the rows...

6 minutes read.