Grid Classes
The power CSS Grid, ready to use in your editor.
Grid classes:
We also offer the best & flexible grid system to design any type of grids.
To convert any div into a grid, you just need to add the class name
gridto the container. And this will turn the container into a grid and all the child elements under this grid container will be displayed as grid elements.
Grid template columns:
grid-colsfollowed by an hyphen and a number is the short form to addgrid-template-columnsproperty to the grid container.An example grid template column class is
grid-cols-1this equals to adding the propertygrid-template-columns: repeat(1, minmax(0, 1fr));grid-cols-3is equals to adding the propertygrid-template-columns: repeat(3, minmax(0, 1fr));to the grid.The same way you can add grid cols until 6.
Grid template rows:
grid-rowsfollowed by an hyphen and a number is the short form to addgrid-template-rowsproperty to the grid container.An example grid template column class is
grid-rows-1this equals to adding the propertygrid-template-rows: repeat(1, minmax(0, 1fr));grid-rows-2is equals to adding the propertygrid-template-rows: repeat(2, minmax(0, 1fr));to the grid.The same way you can add grid cols until 3 rows.
Grid gap:
gapclasses are followed by an hyphen and a number. Gap classes are the quickest way to add gap between grid elements.gap-2is the short form of adding the css propertygap: 8px;As you already know, we follow the 4px spacing system, sogap-2isgap: 8px;andgap-4isgap: 16px;,etc.gap adds same gap between rows and columns.
row-gapclasses can be used to maintain the gap between rows.gapclasses must to be added to thegridcontainers.
Grid column & row start classes:
Unlike the above mentioned grid classes, following classes applies to the child elements under grid. These classes define how the child elements should span and display inside the grid.
col-start-1is an example of grid column start class. We are adding the propertygrid-column-start: 1;.col-start-1is literally asking the element to start at the 1st column. Same way,col-start-3makes the element to start at the 3rd column regardless of the element’s position in the grid container.
Grid column & row end classes:
As start classes start the element from the particular column, end classes end the element at a particular column.
col-end-2is an example of grid column end class. We are adding the propertygrid-column-end: 2;.col-end-2is literally asking the element to end before the 2nd column. Same way,col-end-3makes the element to end before the 3rd column regardless of the element’s position in the grid container.
Grid column & row span classes:
Column span classes are best useful when you want to span an element across multiple columns.
col-span-2is an example of column span class which is same as the CSS property,grid-column: span 2 / span 2;.col-span-2makes the element to span across 2 columns without writing the above column start and end classes.Same way,
col-span-3spans the element to span across 3 columns.