I have divided my div in 3 parts. Header part, content part and footer part.
the CSS looks like that:
<div class = "parent">
<div class = "header"></div>
<div class = "content">
<div class = "whatever"></div>
<div class = "footer"></div>
grid-template-rows: 3rem auto 3rem;
Just to clarify that in your demo above the height of the content div is determined by the height of the content in the whatever div so in essence it is always 100% of .content by default.
I think you may be thinking of a use case like the following where the grid is 100% tall and in that case you would need to set .content to display:grid to allow .whatever to match the height of .content.
If neither of those are what you want then let me know as I’m sure there is a workaround. I have never needed JS to match a height of a parent since about 2002
sorry my question was stupid. I have found the problem. Its not my best day today.
This topic was automatically closed 91 days after the last reply. New replies are no longer allowed.