Css Grid
Tue Aug 06 2024 09:40:50 GMT+0000 (Coordinated Universal Time)
Saved by
@NoFox420
#javascript
.parent-container{
//defining a grid container
display: grid;
//defining rows and columns
grid-template: 50px 50px / 50px 50px;
//defining a row and column gap
gap: 20px 50px;
}
When we use the grid-template propertie, we are explicitly defining grid tracks to lay out our grid items. But when the grid needs more tracks for extra content, it will implicitly define new grid tracks. Additionally, the size values established from our grid-template propertie are not carried over into these implicit grid tracks. But we can define values for the implicit grid tracks.
Let’s say we want any new rows to stay the same value as our explicit row track sizes:
.parent-container {
display: grid;
grid-template: 50px 50px;
grid-auto-rows: 50px;
}
content_copyCOPY
Comments