Alignment of property-values with Definition List - HTML CSS CSS Widget

HTML CSS examples for CSS Widget:Definition List

Description

Alignment of property-values with Definition List

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">
dt {<!--from w ww  . j  a v a2s . c  om-->
   float:left;
   font-weight:bold;
   text-align:right;
   width:6em;
}

dt:after {
   content:':';
   margin-right:2ex;
}
</style> 
 </head> 
 <body> 
  <dl> 
   <dt>
     Name 
   </dt> 
   <dd>
     Test 
   </dd> 
   <dt>
     Surname 
   </dt> 
   <dd>
     Test 
   </dd> 
   <dt>
     Age 
   </dt> 
   <dd>
     24 
   </dd> 
  </dl>  
 </body>
</html>

Related Tutorials