"Sticky" sidebar overflowing vertically - HTML CSS CSS Property

HTML CSS examples for CSS Property:overflow

Description

"Sticky" sidebar overflowing vertically

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 {<!-- w ww .ja va  2s.  c o m-->
   overflow:hidden;
}

.sidebar {
   position:fixed;
   width:201px;
   height:401px;
   background:Chartreuse;
   top:63px;
   bottom:11px;
   overflow:hidden;
}

.content {
   overflow:auto;
   width:100%;
   height:100%;
   padding-right:21px;
}

.content ul li {
   height:301px;
}
</style> 
 </head> 
 <body> 
  <div class="sidebar"> 
   <div class="content"> 
    <ul> 
     <li>Lorem</li> 
     <li>Lorem</li> 
     <li>Lorem</li> 
    </ul> 
   </div> 
  </div>  
 </body>
</html>

Related Tutorials