Align list items to top of ul container - HTML CSS CSS Widget

HTML CSS examples for CSS Widget:UL Alignment

Description

Align list items to top of ul container

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">
.cul {<!-- w w  w.jav a2  s  .  c o  m-->
   list-style-type:none;
   width:100%;
   padding:0;
   margin:0px auto 0;
}

.cli {
   display:inline-block;
   width:11%;
   padding:0px 26px 0;
   background-size:47px;
   vertical-align:top;
   text-align:center;
}

.cli .img {
   background:url('http://www.java2s.com/style/demo/Google-Chrome.png') no-repeat;
   width:47px;
   height:47px;
   margin:0 auto 11px;
}
</style> 
 </head> 
 <body> 
  <div> 
   <ul class="cul"> 
    <li class="cli"> 
     <div class="img"></div> 
     <div>
       test 
     </div> </li> 
    <li class="cli"> 
     <div class="img"></div> 
     <div>
       test 
     </div> </li> 
    <li class="cli"> 
     <div class="img"></div> 
     <div>
       test 
     </div> </li> 
    <li class="cli"> 
     <div class="img"></div> 
     <div>
       test 
     </div> </li> 
    <li class="cli"> 
     <div class="img"></div> 
     <div>
       test 
     </div> </li> 
   </ul> 
  </div>  
 </body>
</html>

Related Tutorials