0

I have the following divs

<div class="top">
   <div class="inner1"></div>
   <div class="inner2"></div>
   <div class="inner3"></div>
</div>

Here's the CSS:

.top { 
    height: 100vh;
}

.div1 {
    min-height: 215px;
    box-sizing: border-box;
    height: 30vh;
}

.div2 { 
    box-sizing: border-box;
    min-height: calc(100vh - 30vh - 265px);
    padding-top: 2.5em;
    margin-top: 0;
    display: table;
}

.div3 {
    min-height: 265px;
    box-sizing: border-box;
    background: white;
    display: table;
    width: 100%;
    font-weight: 700;
    padding-bottom: 42px;
}

I don't want to use calc(100vh - 30vh - 265px) to set the min-height of div 2. How can I have it so that it takes the remaining height (meaning div2 height = 100vh - div1 height - div2 height.

I'm guessing flex could be useful here, but I'm not quite sure how to use it. Any help would be greatly appreciated.

Thanks?

J K
  • 4,883
  • 6
  • 15
  • 24

0 Answers0