Tableless definition list layout - HTML CSS CSS Widget

HTML CSS examples for CSS Widget:Table Layout

Description

Tableless definition list layout

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">
.tabular_data {<!--  ww  w .  j a  v a  2  s . com-->
   padding:6px;
   border-bottom:3px solid Chartreuse;
}

.tabular_data dl, .tabular_data dd, .tabular_data dt {
   display:block;
   text-align:left;
   padding:0;
   margin:0;
   vertical-align:top;
   width:100%;
}

.tabular_data dl {
   border-spacing:0;
}

@media only screen and (min-width:768px)  {
   .tabular_data dl {
      border-spacing:6px 6px;
      display:table;
   }
   
   .tabular_data dd, .tabular_data dt {
      display:table-cell;
   }
   
   .tabular_data dt {
      width:16%;
   }
   
   .tabular_data dd {
      width:85%;
   }

}
</style> 
 </head> 
 <body> 
  <h2> <a name="tutorials">Lorem ipsu</a> </h2> 
  <div class="tabular_data"> 
   <dl> 
    <dt> 
     <a target="_blank" href="">Lore</a> 
    </dt> 
    <dd> 
     <b>Lorem ipsum dolor sit amet, consectetur a</b>Lorem ipsum dolor sit amet, consectetur adipiscing elit 
     <i>Lorem ipsum dolor sit </i>Lor 
    </dd> 
   </dl> 
   <dl> 
    <dt> 
     <a target="_blank" href="">Lore</a> 
    </dt> 
    <dd> 
     <b>Lorem ipsum dolor sit amet,</b>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Morbi ullamcorper molestie lacus sed fermentum. Aliquam era 
     <a target="_blank" href="">Lorem ips</a>Lorem ipsum dolor si 
    </dd> 
   </dl> 
   <dl> 
    <dt> 
     <a target="_blank" href="">Lore</a> 
    </dt> 
    <dd> 
     <b>Lorem ipsum dolor sit amet, conse</b>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Morbi ullamcorper molestie lacus sed fermentum. A 
    </dd> 
   </dl> 
  </div>  
 </body>
</html>

Related Tutorials