Set a ul size according to its containing div - HTML CSS CSS Widget

HTML CSS examples for CSS Widget:UL

Description

Set a ul size according to its containing div

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">
#container {<!-- w  w  w  . j a va  2  s .com-->
   height:100px;
   width:301px;
   overflow-y:auto;
   overflow-x:none;
   border:2px solid Chartreuse;
}
</style> 
 </head> 
 <body> 
  <div id="container"> 
   <ul> 
    <li>Lorem ip</li> 
    <li>Lorem ip</li> 
    <li>Lorem ip</li> 
    <li>Lorem ip</li> 
    <li>Lorem ip</li> 
    <li>Lorem ip</li> 
    <li>Lorem ip</li> 
    <li>Lorem ip</li> 
   </ul> 
  </div>  
 </body>
</html>

Related Tutorials