Responsive div's floating and centered - HTML CSS CSS Layout

HTML CSS examples for CSS Layout:Responsive Layout

Description

Responsive div's floating and centered

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 ww.  ja  v a  2 s  .c om-->
   background-color:Chartreuse;
   width:501px;
   text-align:center;
}

.item {
   display:inline-block;
   background-color:yellow;
   width:100px;
   height:100px;
}
</style> 
 </head> 
 <body> 
  <div class="container"> 
   <div class="item"></div> 
   <div class="item"></div> 
   <div class="item"></div> 
   <div class="item"></div> 
   <div class="item"></div> 
   <div class="item"></div> 
  </div>  
 </body>
</html>

Related Tutorials