Make small square boxes inside panel in css - HTML CSS CSS Layout

HTML CSS examples for CSS Layout:Box

Description

Make small square boxes inside panel in 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 {<!-- w  w w. j  a va  2s .co  m-->
   width:301px;
   height:401px;
   border:2px solid Chartreuse;
}

.box {
   width:100px;
   margin:auto;
   height:81px;
   border:2px solid yellow;
   margin-top:11px;
   text-align:center;
   vertical-align:middle;
}

.header {
   text-align:center;
   background-color:blue;
}

.middle {
   line-height:61px;
   height:81px;
}
</style> 
 </head> 
 <body> 
  <div class="container"> 
   <div class="header">
     Lorem ipsum d 
   </div> 
   <div class="box"> 
    <div class="header">
      Lorem 
    </div> 
    <span class="middle">Lorem i</span> 
   </div> 
   <div class="box"> 
    <div class="header">
      Lorem 
    </div> 
    <span class="middle">Lorem i</span> 
   </div> 
   <div class="box"> 
    <div class="header">
      Lorem 
    </div> 
    <span class="middle">Lorem i</span> 
   </div> 
  </div>  
 </body>
</html>

Related Tutorials