CodePen

HTML

            
              <!--

-->

<section>
  <div>
    <div class="small">1</div>
    <div class="medium">2</div>
    <div class="large">3</div>
    <div class="medium">4</div>
    <div class="small">5</div>
  </div>
</section>
            
          
!
via HTML Inspector

CSS

            
              /******************
* Layout specific
*******************/
@media screen and (max-width: 699px) {
  body {
    min-width: 30rem;
    width: auto !important;
    width: 30rem;
    padding: 1rem;
    
    > section {
      width: 28rem; // (420px - (2 * 14px)) / 14px;
      
      > div {
        width: 29rem;
        
        > div {
          width: 28rem;
        }
      }
    }
  }
}

@media screen and (min-width: 700px) {
  body {
    min-width: 70rem;
    width: auto !important;
    width: 70rem;
    padding: 2rem;
    
    > section {
      width: 66rem; // (980px - (2 * 28px)) / 14px;
        
      > div {
        width: 67rem;
        
        > div {
          height: 20rem;
          
          &.small {
            width: 20rem;
          }
        
          &.medium {
            width: 45rem;
          }
        
          &.large {
            width: 66rem;
          }
        }
      }
    }
  }
}

/******************
* Basic CSS
*******************/
* {
  box-sizing: border-box;
}

body {
  overflow-x: hidden;
  background-color: #333;
  color: #fff;
  text-align: center;
  
  > section {
    position: relative;
    overflow: hidden;
    margin: 0 auto;
    font-size: 0;

    > div {
      > div {
        display: inline-block;
        margin: 0 1rem 1rem 0;
        background-color: #666;
        font-size: 10rem;
        line-height: 20rem;
      }
    }
  }
}
            
          
!
? ?
? ?
Must be a valid URL.
+ add another resource
via CSS Lint

JS

            
              
            
          
!
Must be a valid URL.
+ add another resource
via JS Hint
Loading ..................