Space between elements when padding:0 and margin:0 - HTML CSS CSS Property

HTML CSS examples for CSS Property:padding

Description

Space between elements when padding:0 and margin:0

Demo Code

ResultView the demo in separate window

<html>
 <head> 
  <style type="text/css">
* {<!--from   ww  w .ja v a 2  s  .c om-->
   margin:0;
   padding:0;
}

span {
   float:left;
}
</style> 
 </head> 
 <body> 
  <div style="border-style:solid; border-color:red;height:20px;"> 
   <span>Lo</span> 
   <span style="display:inline-block;border-width:1px;">Lorem</span> 
  </div>  
 </body>
</html>

Related Tutorials