Make 100% height div with overflow:auto - HTML CSS CSS Layout

HTML CSS examples for CSS Layout:Height

Description

Make 100% height div with overflow:auto

Demo Code

ResultView the demo in separate window

<html>
 <head> 
  <meta name="viewport" content="width=device-width, initial-scale=1"> 
  <style id="compiled-css" type="text/css">
html, body {
   height:100%;
   background:Chartreuse;
}

#menu {<!-- ww w.j  a v a 2  s  .  co  m-->
   background:yellow;
   width:221px;
   height:100%;
}

#menu ul {
   height:100%;
   overflow:auto;
}
</style> 
 </head> 
 <body> 
  <div id="menu"> 
   <ul> 
    <li>my</li> 
    <li>my</li> 
    <li>my</li> 
    <li>my</li> 
    <li>my</li> 
    <li>my</li> 
    <li>my</li> 
    <li>my</li> 
    <li>my</li> 
    <li>my</li> 
    <li>my</li> 
    <li>my</li> 
    <li>my</li> 
    <li>my</li> 
    <li>my</li> 
    <li>my</li> 
   </ul> 
  </div>  
 </body>
</html>

Related Tutorials