Background-color of a ul expanding to overflow:auto - HTML CSS CSS Widget

HTML CSS examples for CSS Widget:UL Color

Description

Background-color of a ul expanding to 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">
.list_container {<!--from ww w . j  a  v  a2  s. com-->
   height:146px;
   width:151px;
   border:3px solid Chartreuse;
   overflow:auto;
   white-space:nowrap;
   background-color:yellow;
}

#list {
   list-style-type:none;
   height:100%;
}

#list, #list li {
   margin:0;
   padding:0;
}
</style> 
 </head> 
 <body> 
  <div class="list_container"> 
   <ul id="list"> 
    <li>Lorem ipsum dolor sit amet, c</li> 
    <li>Lorem ipsum dolor sit amet,</li> 
    <li>Lorem ipsum dolor sit amet, con</li> 
    <li>Lorem ipsum dolor sit amet, con</li> 
    <ul> 
    </ul> 
   </ul> 
  </div>  
 </body>
</html>

Related Tutorials