CSS Grid Not Expanding with Dynamic Height in Angular - Seeking Layout Solution
I'm stuck on something that should probably be simple. I'm working on an Angular application where I utilize CSS Grid for layout. The grid items are dynamically populated based on user input, which affects their heights, but I notice that the grid container doesn't expand to accommodate the content properly. Instead, I'm left with a fixed height that cuts off the grid items, causing an overflow. Here's a simplified version of my CSS: ```css .grid-container { display: grid; grid-template-columns: repeat(3, 1fr); grid-auto-rows: minmax(100px, auto); gap: 10px; overflow: hidden; } ``` My HTML looks something like this: ```html <div class="grid-container"> <div class="grid-item" *ngFor="let item of items">{{ item }}</div> </div> ``` I initially set a fixed height on the grid container to keep it structured, but as the content varies, I realized this isn't practical. I've tried removing the height property, but then it doesn't render as expected when the content is not enough to fill the area. I also looked into using `grid-auto-rows` in hopes that it would help with varying content, but the issue persists. The items overflow rather than forcing the grid container to expand. Is there a recommended solution or best practice for handling a dynamic height in a CSS Grid context, especially in Angular? Any insights on achieving a responsive layout without cutting off content would be greatly appreciated. Additionally, if there's a better approach to structuring the grid or items, I'm all ears! I'm using Angular 13 and trying to ensure it works well across all modern browsers. My development environment is Windows.