position a large number of absolute divs with a small amount of CSS - HTML CSS CSS Layout

HTML CSS examples for CSS Layout:Absolute Position

Description

position a large number of absolute divs with a small amount of CSS

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">
#container {<!--from   w w  w  .ja v a2 s . c  o m-->
   position:absolute;
   top:-21px;
   left:21px;
}

.square {
   background-color:Chartreuse;
   width:21px;
   height:21px;
   line-height:21px;
   position:relative;
   top:2px;
   color:yellow;
   text-align:center;
}
</style> 
 </head> 
 <body> 
  <div id="container">
    Lorem ipsum dolor s 
   <div class="square">
     Lor 
    <div class="square">
      Lor 
     <div class="square">
       Lor 
      <div class="square">
        Lor 
       <div class="square">
         Lor 
        <div class="square">
          Lor 
        </div> 
       </div> 
      </div> 
     </div> 
    </div> 
   </div> 
  </div>  
 </body>
</html>

Related Tutorials