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: