# CSS Grid

* # Grid
    
* # grid-template-columns
    
* # grid-template-rows
    
* # gap
    
* # grid-row-gap
    
* # grid-column-gap
    
* # grid-column-start
    
* # grid-column-end
    

# Grid

Grid is used for rows and columns to style them.It is two dimensional layout system with rows and columns.There are so many properties for grid container(parent) and grid item (child).

**Syntax:**

display: grid;

**Example:**

<iframe height="300" style="width:100%" src="https://codepen.io/Ayasha7/embed/yLxzEGJ?default-tab=html">
  See the Pen <a href="https://codepen.io/Ayasha7/pen/yLxzEGJ">
  Grid</a> by Ayasha (<a href="https://codepen.io/Ayasha7">@Ayasha7</a>)
  on <a href="https://codepen.io">CodePen</a>.
</iframe>

# grid-template-columns

It defines the number of columns and it's widths.

**Syntax:**

grid-template-columns: 60px 60px;

# grid-template-rows

It defines the number of rows and it's heights.

**Syntax:**

grid-template-rows:

# gap

It gives gaps between rows and columns. And it is a Shorthand property for row-gap and column-gap.

**Syntax:**

gap: 10px;

# grid-row-gap

It gives size of gaps between rows.

**Syntax:**

grid-row-gap: 5px;

**Example:**

<iframe height="300" style="width:100%" src="https://codepen.io/Ayasha7/embed/oNPGyqE?default-tab=html">
  See the Pen <a href="https://codepen.io/Ayasha7/pen/oNPGyqE">
  grid-row-gap</a> by Ayasha (<a href="https://codepen.io/Ayasha7">@Ayasha7</a>)
  on <a href="https://codepen.io">CodePen</a>.
</iframe>

# grid-column-gap

It gives size of gaps between columns.

**Syntax:**

grid-column-gap: 8px;

**Example:**

<iframe height="300" style="width:100%" src="https://codepen.io/Ayasha7/embed/dyqVKJd?default-tab=html">
  See the Pen <a href="https://codepen.io/Ayasha7/pen/dyqVKJd">
  Untitled</a> by Ayasha (<a href="https://codepen.io/Ayasha7">@Ayasha7</a>)
  on <a href="https://codepen.io">CodePen</a>.
</iframe>

# grid-column-start and grid-column-end

It specifies the grid column items in start position and the end position.

**Syntax:**

grid-column-start: 2;

grid-column-end: 3;

**Example:**

<iframe height="300" style="width:100%" src="https://codepen.io/Ayasha7/embed/LYJzrrQ?default-tab=html">
  See the Pen <a href="https://codepen.io/Ayasha7/pen/LYJzrrQ">
  grid-col-start</a> by Ayasha (<a href="https://codepen.io/Ayasha7">@Ayasha7</a>)
  on <a href="https://codepen.io">CodePen</a>.
</iframe>

# grid-row-start and grid-row-end

It specifies the grid row items in start position and the end position.

**Syntax:**

grid-row-start: 2;

grid-row-end: 3;

<iframe height="300" style="width:100%" src="https://codepen.io/Ayasha7/embed/xxaXzaX?default-tab=html">
  See the Pen <a href="https://codepen.io/Ayasha7/pen/xxaXzaX">
  grid-row-start</a> by Ayasha (<a href="https://codepen.io/Ayasha7">@Ayasha7</a>)
  on <a href="https://codepen.io">CodePen</a>.
</iframe>
