Add fixed margins to a responsive grid - HTML CSS CSS Widget

HTML CSS examples for CSS Widget:Table Responsive

Description

Add fixed margins to a responsive grid

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">
.wrapper {<!--from w ww.j  a  v a 2 s  .  c o m-->
   margin:0 auto;
   max-width:941px;
   background:Chartreuse;
}

.my {
   color:yellow;
   font-weight:bold;
   font-size:23px;
   text-align:center;
   margin-bottom:35px;
}

.one {
   height:311px;
   background:lightblue;
   display:inline-block;
   float:left;
}

.two {
   height:311px;
   background:lightpink;
   display:inline-block;
   float:left;
}

.three {
   height:311px;
   background:lightyellow;
   display:inline-block;
   float:left;
}

.one, .two, .three
 {
   margin:11px;
   width:calc(34.34% - 21px);
}
</style> 
 </head> 
 <body> 
  <div class="wrapper"> 
   <div class="ideas__gallery"> 
    <h3 class="my">Discover holiday activity ideas</h3> 
    <div class="one"></div> 
    <div class="two"></div> 
    <div class="three"></div> 
    <div class="four"></div> 
    <div class="five"></div> 
    <div class="six"></div> 
    <div class="seven"></div> 
   </div> 
  </div>  
 </body>
</html>

Related Tutorials