×

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 rows and the size of the grid's rows. The number of values assigned to this class determines the number of rows.

Grid Template Rows

The grid templates rows are classified as:

  • grid-rows-1: Each row only gives up one row.
  • grid-rows-2: Only two rows are conceded each row.
  • grid-rows-3: Only three rows are conceded each row.
  • grid-rows-4: Only four rows are conceded each row.
  • grid-rows-5: Only five rows are conceded each row.
  • grid-rows-6: Six rows are conceded each row.
  • gird-rows-none: The grid-row attribute is ignored (does not follow).

Syntax:

 <element class="grid grid-rows-number"> Contents... </element>

Example: 1

<!DOCTYPE html>




<head>

    <title>grid-rows Class of Tailwind </title>




    <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>grid-rows Class - Tailwind CSS </b>




    <div id="main" class="grid grid-rows-3 grid-flow-col">

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

Example: 2

<!DOCTYPE html>

<head>

    <title>grid-rows Class of Tailwind </title>

    <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>grid-rows Class - Tailwind CSS </b>




    <div id="main" class="grid grid-rows-2 grid-flow-col">

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

Related Topics

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

CSS flexbox is an important element for frontend development; there are two flex-grow options in Tailwind CSS, and all attributes are covered in class form. It is an alternative to...

3 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 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 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 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 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 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 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 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 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 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 Min-Width

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-width property. This...

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