Css height and overflow - HTML CSS CSS Property

HTML CSS examples for CSS Property:overflow

Description

Css height and overflow

Demo Code

ResultView the demo in separate window

<html lang="en">
 <head> 
  <meta name="viewport" content="width=device-width, initial-scale=1"> 
  <style id="compiled-css" type="text/css">
body .d2<!--from ww w.  j a v  a  2  s.c  o  m-->
 {
   height:calc( 100% - 91px);
}
</style> 
 </head> 
 <body> 
  <title>Lorem ip</title> 
  <style>
*, *:before, *:after {
   padding:0;
   margin:0;
   box-sizing:border-box;
}

html,body {
   height:100%;
   overflow-y:hidden;
}

.d{
}
.d1 {
   height:100%;
   overflow:hidden;
   position:relative;
}

.d2 {
   display:block;
   position:relative;
   background:yellow;
   overflow-y:auto;
   height:91%;
}

.d3 {
   height:91px;
   background:blue;
}
</style> 
  <div class="d d1"> 
   <div class="d3"> 
    <p>Lorem ipsu</p> 
    <p>Lorem ipsu</p> 
    <p>Lorem ipsu</p> 
    <p>Lorem ipsu</p> 
    <p>Lorem ipsu</p> 
   </div> 
   <div class="d2"> 
    <p>Lorem ip</p> 
    <p>Lorem ip</p> 
    <p>Lorem ip</p> 
    <p>Lorem ip</p> 
    <p>Lorem ip</p> 
    <p>Lorem ip</p> 
    <p>Lorem ip</p> 
    <p>Lorem ip</p> 
    <p>Lorem ip</p> 
    <p>Lorem ip</p> 
    <p>Lorem ip</p> 
    <p>Lorem ip</p> 
    <p>Lorem ip</p> 
    <p>Lorem ip</p> 
    <p>Lorem ip</p> 
    <p>Lorem ip</p> 
    <p>Lorem ip</p> 
    <p>Lorem ip</p> 
    <p>Lorem ip</p> 
    <p>Lorem ip</p> 
    <p>Lorem ip</p> 
    <p>Lorem ip</p> 
    <p>Lorem ip</p> 
    <p>Lorem ip</p> 
    <p>Lorem ip</p> 
    <p>Lorem ip</p> 
    <p>Lorem ip</p> 
    <p>Lorem ip</p> 
    <p>Lorem ip</p> 
    <p>Lorem ip</p> 
    <p>Lorem ip</p> 
    <p>Lorem ip</p> 
    <p>Lorem ip</p> 
    <p>Lorem ip</p> 
    <p>Lorem ip</p> 
    <p>Lorem ip</p> 
    <p>Lorem ip</p> 
    <p>Lorem ip</p> 
    <p>Lorem ip</p> 
    <p>Lorem ip</p> 
    <p>Lorem ip</p> 
    <p>Lorem ip</p> 
    <p>Lorem ip</p> 
    <p>Lorem ip</p> 
    <p>Lorem ip</p> 
    <p>Lorem ip</p> 
    <p>Lorem ip</p> 
    <p>Lorem ip</p> 
    <p>Lorem ip</p> 
    <p>Lorem ip</p> 
    <p>Lorem ip</p> 
    <p>Lorem ip</p> 
    <p>Lorem ip</p> 
    <p>Lorem ip</p> 
    <p>Lorem ip</p> 
    <p>Lorem ip</p> 
    <p>Lorem ip</p> 
    <p>Lorem ipsum </p> 
   </div> 
  </div>  
 </body>
</html>

Related Tutorials