I have a grid layout with four grid areas, on desktop the layout changes to a two column.
Mobile:
Desktop: current
Desktop: preferred
The second grid item is placed in the sidebar as the first item, then the last grid item follows that. What I’m trying to do is pull the fourth grid item up so it is placed after the second item.
But as I’m using grid you can’t do this as it needs to fill a grid area. Is it possible at all using grid?
Trying to make the layout condense vertically to fill the empty gap in the sidebar.
2
Answers
I would implement this design using a grid to manage the horizontal component of the layout, but flex for the vertical component of the layout.
When running this snippet, use the full page link and adjust the size of your browser window to test the responsiveness.
You are better off implementing this with flexbox.
If you still want to use a grid layout, then combine
grid-template-areas
andgrid-auto-rows
in a rather dirty style. But you still need to adddisplay:grid;
to the parent so that it works in firefox…