Spacing with table-cell - HTML CSS CSS Widget

HTML CSS examples for CSS Widget:Table Cell

Description

Spacing with 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">
.widget {<!--from  ww w. j  av a2 s .co  m-->
   display:block;
   margin:0px;
   padding:0px;
}

.button {
   display:inline-block;
   border:2px solid Chartreuse;
   margin:0px;
   padding:0px;
}

.content {
   display:table;
   width:100%;
   height:100%;
   margin:0px;
   padding:0px;
   border-spacing:0;
   border-collapse:collapse;
}

.icon {
   display:table-cell;
   width:16px;
   height:16px;
   margin:0px;
   padding:0px;
   vertical-align:middle;
   text-align:center;
}

.label {
   display:table-cell;
   margin:0px;
   padding:0px;
   padding-left:4px;
   vertical-align:middle;
}
</style> 
 </head> 
 <body> 
  <div class="widget"> 
   <div class="button"> 
    <div class="content"> 
     <div class="icon">
       Lor 
     </div> 
     <div class="label">
       Lorem 
     </div> 
    </div> 
   </div> 
   <!--
    --> 
   <div class="button"> 
    <div class="content"> 
     <div class="icon">
       Lor 
     </div> 
     <div class="label">
       Lorem ip 
     </div> 
    </div> 
   </div> 
   <!--
    --> 
   <div class="button"> 
    <div class="content"> 
     <div class="icon">
       Lor 
     </div> 
     <div class="label">
       Lorem ipsum 
     </div> 
    </div> 
   </div> 
  </div>  
 </body>
</html>

Related Tutorials