Grid
Container Properties
display
- Determines if the container is a grid container.
- Example: display: grid; or display: inline-grid;
grid-template-columns / grid-template-rows
- Defines the columns and rows of the grid with track sizes.
- Example: grid-template-columns: 1fr 2fr 1fr;
grid-template-areas
- Defines a grid template by referencing the names of the grid areas.
- Example:
grid-template-areas:
"header header header"
"sidebar main main"
"footer footer footer";
grid-gap (or gap)
- Defines the size of the gap between the rows/columns.
- Example: grid-gap: 10px 15px; or gap: 10px;
grid-auto-columns / grid-auto-rows
- Specifies the size of implicitly created columns/rows.
- Example: grid-auto-columns: 100px;
grid-auto-flow
- Controls how auto-placed items are inserted in the grid.
- Example: grid-auto-flow: row;
Grid Item Properties
grid-column-start / grid-column-end / grid-row-start / grid-row-end
- Determine where a grid item starts and ends.
- Example: grid-column-start: 1; grid-column-end: 3;