Use calc to calculate min-height - HTML CSS CSS Layout

HTML CSS examples for CSS Layout:Height

Description

Use calc to calculate min-height

Demo Code

ResultView the demo in separate window

<html>
 <head> 
  <title>Vertical flexbox</title> 
  <meta name="viewport" content="width=device-width, initial-scale=1"> 
  <style id="compiled-css" type="text/css">
header {<!--from  w w  w .ja  v  a  2  s .com-->
   height:131px;
   width:100%;
   background:white;
}

.between {
   min-height:calc(100vh - 231px);
   width:100%;
   background:orange;
}

footer {
   height:100px;
   background-color:Chartreuse;
   width:100%;
}
</style> 
 </head> 
 <body> 
  <header>
    HEADER 
  </header> 
  <div class="between">
    lol 
  </div> 
  <footer>
    FOOTER 
  </footer>  
 </body>
</html>

Related Tutorials