vertically align to the lists - HTML CSS CSS Widget

HTML CSS examples for CSS Widget:UL Alignment

Description

vertically align to the lists

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">
ul {<!-- ww w . j ava 2 s .  com-->
   width:51%;
   display:table;
}

li {
   display:table-row;
   list-style:none;
   height:100px;
}

li>span {
   display:table-cell;
   vertical-align:middle;
   border:2px solid Chartreuse;
}
</style> 
 </head> 
 <body> 
  <ul> 
   <li> <span>Lorem ipsum dolor sit amet, consectetur adipiscing elit.</span> </li> 
   <li> <span>Lorem ipsum dolor sit amet, consectetur adipiscing elit.</span> </li> 
   <li> <span>Lorem ipsum dolor sit amet, consectetur adipiscing elit.</span> </li> 
   <li> <span>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Morbi ullamcorper molestie lacus sed fermentum. Aliquam</span> </li> 
  </ul>  
 </body>
</html>

Related Tutorials