Spacing in <li> tags with display table-cell - HTML CSS CSS Widget

HTML CSS examples for CSS Widget:Table Cell

Description

Spacing in <li> tags with display table-cell

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">
body {<!--   w ww  .  j a  v a 2s  .  c  om-->
   text-align:center;
}

.achievements ul {
   margin:0 auto;
   padding:0;
   list-style:none;
   display:table;
   border-spacing:11px;
   border-collapse:separate;
}

.achievements ul li {
   min-width:305px;
   min-height:209px;
   vertical-align:middle;
   display:table-cell;
   box-sizing:border-box;
   -webkit-box-sizing:border-box;
   -moz-box-sizing:border-box;
   box-shadow:0px 0px 4px Chartreuse;
   color:yellow;
   margin-right:15px;
   padding-bottom:33px;
   max-width:304px;
   background:blue;
   font-family:'gafata';
   padding-top:33px;
   line-height:24px;
   text-align:center;
}

.achievements ul li img {
   vertical-align:middle;
}
</style> 
 </head> 
 <body> 
  <div class="achievements"> 
   <h2>Lorem<span>Lorem ipsum </span> </h2> 
   <ul> 
    <li> <img src="https://www.java2s.com/style/demo/InternetExplorer.png"> </li> 
    <li> <img src="https://www.java2s.com/style/demo/InternetExplorer.png"> </li> 
    <li> <img src="https://www.java2s.com/style/demo/Safari.png"> </li> 
    <li> <img src="https://www.java2s.com/style/demo/Firefox.png"> </li> 
   </ul> 
  </div>  
 </body>
</html>

Related Tutorials