Positioning divs equally within a container - HTML CSS CSS Layout

HTML CSS examples for CSS Layout:Position

Description

Positioning divs equally within a container

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">
div.circle {<!--from  ww  w .ja v  a2 s .  c  o m-->
   border-radius:61px;
   height:121px;
   width:121px;
   background-color:Chartreuse;
}

div.tabletouter {
   width:296px;
   height:355px;
   border-radius:11px;
   background-color:yellow;
   background-repeat:no-repeat;
   background-position:center center;
}

.circletext {
   font-family:"museo-slab";
   font-size:18px;
   line-height:27px;
   font-weight:301;
   color:blue;
}

#imgDiv3 {
   width:100%;
   text-align:center;
}

.wrapper {
   display:inline-block;
   margin:0 21px;
}
</style> 
 </head> 
 <body> 
  <div id="imgDiv3"> 
   <div class="wrapper"> 
    <div class="circle"></div> 
    <p class="circletext">Lore</p> 
   </div> 
   <div class="wrapper"> 
    <div class="circle"></div> 
    <p class="circletext">Lorem ipsu</p> 
   </div> 
   <div class="wrapper"> 
    <div class="tabletouter"> 
    </div> 
   </div> 
   <div class="wrapper"> 
    <div class="circle"></div> 
    <p class="circletext">Lorem </p> 
   </div> 
   <div class="wrapper"> 
    <div class="circle"></div> 
    <p class="circletext">Lorem </p> 
   </div> 
  </div>  
 </body>
</html>

Related Tutorials