ARTICLE AD BOX
display:subgrid solves the issue.
Subgrid is crossbrowser as of time of update (11/2023)
A couple of resources links from Rachel Andrew (a CSS-Grid envangalist)
https://rachelandrew.co.uk/archives/2019/04/16/css-subgrid-news-and-demos/and
YouTube video on subgrid
Resulting output (FF Nightly)
Arguably, you could achieve the same thing without subgrid though it's a bit more of a pain.
In my example, I didn't change the HTML so I use display: contents to sort of bring the children up one level of the DOM tree. But if you can change your markup and don't mind the resulting mess, you could also achieve this without display: contents.
281k31 gold badges381 silver badges506 bronze badges
6 Comments
as of today, display:subgrid is not fully supported on all browsers. This is not a solution at this time. caniuse.com/#feat=css-subgrid
2020-05-19T23:52:21.177Z+00:00
@RazvanZamfir it depends on the exact requirements. display: contents is useful for flexbox too, but flexbox isn't always the best for 2D layouts like this one, so you usually end up having one parent flex with many flex children, and sometimes you still can't do the exact thing you're trying to do. depends on the requirements.
2021-09-04T18:38:07.477Z+00:00
A little bit of JavaScript can help out . By getting the maximum height , you can define that to all classes
Explore related questions
See similar questions with these tags.




