![]() |
VOOZH | about |
It is a CSS property that offers a grid-based layout system, with rows and columns, making it easier to design web pages without floats and positioning.
Syntax:
grid: none|grid-template-rows / grid-template-columns|grid-template-areas|
grid-template-rows / [grid-auto-flow] grid-auto-columns|[grid-auto-flow]
grid-auto-rows / grid-template-columns|initial|inherit;
Property values:
| Value | Description |
|---|---|
| none | It is default value no specific size mentioned for row and column. |
| grid-template-rows / grid-template-columns | It is used to specifies the size of rows and columns. |
| grid-template-areas | It is used to specifies the grid layout using named items. |
| grid-template-rows / grid-auto-columns | It is used to specifies the auto size(height) and sets the auto size columns. |
| grid-auto-rows / grid-template-columns | It is used to specifies the auto size and sets the auto grid size columns. |
| grid-template-rows / grid-auto-flow grid-auto-columns | It is used to specifies how to place items and auto size row and columns. |
| grid-auto-flow grid-auto-rows / grid-template-columns | It is used to specifies how to place items and auto size row and grid-template columns. |
Example 1: Grid with 2-rows and 4-column.
Output :👁 Image
This can be used as a shorthand property for :
Example 2: This is example for the grid-template-rows and grid-template-columns.
Output : Height of the first row is set to 100px and height of the second row is set to 200px and width of every column is set to 156px.
Supported Browsers: The browser supported by CSS | grid Property are listed below: