🔥Limited Offer: Get 50% OFFon AI & Full Stack Courses🔥
Back to CSS Notes
Topic #180

Grid Gaps


CSS Grid Gaps

The space between the rows and columns in a grid container are called gaps (or gutters).

The gaps are created between the grid rows and columns, not on the outer edges of the grid container.

image

The default size of the gap is 0, which means that there are no spacing between grid items.

The size of the gap can be adjusted with the following properties:

  • column-gap - Specifies the gap between grid columns
  • row-gap - Specifies the gap between grid rows
  • gap - Shorthand property for row-gap and column-gap

The CSS column-gap Property

The column-gap property specifies the gap between the columns in a grid.

Example

.container {

  display: grid;
  column-gap: 50px;
}

The CSS row-gap Property

The row-gap property specifies the gap between the rows in a grid.

Example

  .container {

  display: grid;
  row-gap: 50px;
}

The CSS gap Property

The gap property is a shorthand property for row-gap and column-gap.

If a single value is provided, it applies the same gap to both rows and columns.

If two values are provided, the first value sets the row-gap, and the second value sets the column-gap.

Example

  .container {

  display: grid;
  gap: 50px;
}

Example

  .container {

  display: grid;
  gap: 30px 100px;
}

CSS Grid Gap Properties

Property Description
column-gap Specifies the gap between the grid columns
gap A shorthand property for row-gap and column-gap
row-gap Specifies the gap between the grid rows

Want to go beyond the notes?

Join CodingNow 2.0's CSS course — live mentorship, real projects, and 100% placement support.

Enroll Now — Free Demo Available

Grid Gaps – FAQs

Quick answers about learning Grid Gaps in CSS.

This free note from CodingNow 2.0 explains Grid Gaps in CSS — concept, syntax and worked code examples you can copy, run and revise before interviews.
Yes. Every CSS topic on CodingNow 2.0, including Grid Gaps, is 100% free with no signup required.
With focused practice, most students grasp Grid Gaps in 1–3 days from these notes; pairing it with CodingNow 2.0's mentor-led course takes you to job-ready depth faster.
Use the code examples in this note, then ask doubts for free on the CodingNow 2.0 Community (/community) — expert instructors answer within 24 hours.
WhatsApp
Call NowEnroll Now