I have a two column layout in CSS grid and would like to toggle to a single column layout at 1024px.
.page {
display: grid;
grid-template-columns: 50% 50%;
grid-template-rows: auto;
grid-column-gap: 5pt;
grid-row-gap: 5pt;
}
@media (max-width: 1024px){
.page{
display: block;
}
}
Is changing the display type a complete solution for disabling grid-template-rows
etc., or should they explicitly reset?
Are there any "gotchas" when setting display types using grid.
display: block
you can dogrid-template-columns: auto
for a 1 column layout thereby not losing the gap between the divs - see jsfiddle.net/0q7h25dw – Ribaudo