Set height of list items to fill fluid parent height - HTML CSS CSS Widget

HTML CSS examples for CSS Widget:UL Element

Description

Set height of list items to fill fluid parent height

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 {<!--from  w  w w.  ja v  a 2  s . com-->
   position:relative;
}

#tabs-wrapper, #content {
   display:inline-block;
}

#tabs-wrapper {
   background:Chartreuse;
   position:absolute;
   top:0;
   left:0;
   right:71%;
   bottom:0;
   padding:0;
   margin:0;
}

#tabs {
   display:table;
   height:100%;
   width:100%;
   margin:0;
   padding:0;
}

#tabs li {
   display:table-row;
   text-align:center;
}

#tabs li:nth-child(even) {
   background:yellow;
}

#content {
   width:71%;
   margin-left:31%;
   background:blue;
}
</style> 
 </head> 
 <body> 
  <div id="container"> 
   <div id="tabs-wrapper"> 
    <ul id="tabs"> 
     <li>Lorem </li> 
     <li>Lorem </li> 
     <li>Lorem </li> 
     <li>Lorem </li> 
    </ul> 
   </div> 
   <div id="content"> 
    <p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Morbi ullamcorper molestie lacus sed fermentum. Aliquam erat volutpat. Vestibulum tortor neque, ornare vitae tempor hendrerit, luctus at neque. Phasellus sed quam pharetra, tincidunt tortor in, pharetra nisl. Maecenas aliquam luctus mauris, vitae venenatis diam imperdiet vel. Donec tortor diam, pretium vitae nibh vitae, consectetur lacinia sem. Proin luctus facilisis volutpat. Ut semp</p> 
   </div> 
  </div>  
 </body>
</html>

Related Tutorials