Can I set a div's height as a percentage based on another divs height that is not the parent?

Use flexbox for your the div that contains both divs your mentioning and make ‘Div2’ to expand that way it’ll fill the rest of the space and only when there’s space available:

1 Like