I'm trying to do something a little tricky with css.
On my page, I have two divs that are side by side. The contents of both divs can change (it can have more of less) based on user action.
Div #1 (the left div) needs to be dependent on the height of div #2 (the right div). Div #1 should fill up the remaining space of div #2, but it shouldn't go past the height of div #2. Its overflow should be scrolled.
However div #2's height should NOT be limited, it should be able to grow or shrink as needed, with no scrolling.
I can set div #1 to a certain height and give its overflow a scroll, but if div #2 grows it looks like this:
I want div #1 to grow with div #2, but not extend past it.
In short, div #1's height needs to be dependent on div's #2.
I made a demo for this: https://stackblitz.com/edit/dependent-height-demo?file=app/app.component.css
I want the css to happen (ideally) in app.component.css
, because in the real app it will be difficult to affect the styling on the components.
(EDIT: stackoverflow is saying this is a duplicate of "How can you set the height of an outer div to always be equal to a particular inner div?" It's not since this doesn't involve an inner div, there're two divs next to each other. It's different, and that question's solution doesn't help me.)
Thanks for any assistance you can offer!