make list items vertically centered - HTML CSS CSS Widget

HTML CSS examples for CSS Widget:UL Element

Description

make list items vertically centered

Demo Code

ResultView the demo in separate window

<html lang="en">
 <head> 
  <title>Lorem ipsum </title> 
  <style>
html, body {
   height:100%;
}

.container {<!--  w  ww.ja  va2s  .co  m-->
   display:table;
   height:100%;
}

.inner-container {
   display:table-cell;
   height:100%;
   vertical-align:middle;
}
</style> 
 </head> 
 <body translate="no"> 
  <div class="container"> 
   <div class="inner-container"> 
    <ul class="list"> 
     <li>L</li> 
     <li>L</li> 
     <li>L</li> 
     <li>L</li> 
    </ul> 
   </div> 
  </div>  
 </body>
</html>

Related Tutorials