🌐CSS grid
positioning layouts into rows and columns
grid
By default, the display: grid
works quite like display: block
:
The code above would simply display four card-like containers on top of each other:
[ a ] [ b ] [ c ] [ d ]
grid-template-columns
However, if we were to introduce another property into .grid
called grid-template-columns
we could create an layout in a much easier fashion, without having too many class names:
This would simply create a grid of three columns:
first column: 100px wide
middle column: 200px wide
last column: 100px wide
Last updated