Let's say I have structure like this:
parent
-div_child1
-div_child2
-div_child3
-div_child4
Where parent
has a grid style like:
grid-template-areas:
"a b"
"c c";
however, the amount of children can differ and can be at least 3, therefore, in order to fit the full content of child 3 in style like this: https://i.stack.imgur.com/t00sE.jpg
I had to force last row to have same-defined column names. The problem arises when there are more children. I cant put them into separate cells now so I put them all in grid c
which leads to the overlapping issues I cant seems to find any way to solve. Honestly, I'd be just happy to make them respect each other width and that would be enough for me.
I sense there are 2 possible solutions:
If there are more than 3 children - define more columns and place them in separate. This would work but then there is no way for me to make situation work with just 3 children since I can't assign child3 to multiple named
gird-areas
to take full row space nor I can hide them somehow inside that child codeblock so the 3rd cell can take remaining space of the row.There is a way to align multiple items inside a cell of a grid but. I never found any info on that.
EXAMPLES:
With 3 children: https://www.w3schools.com/code/tryit.asp?filename=G4QC3C4YA3HS
Same parent but with 4 children: https://www.w3schools.com/code/tryit.asp?filename=G4QC5VAA6J4E (overlapping issue)
Remember: I cannot change parent for different cases, its content/children autopopulated!