CodePen

HTML

            
              
            
          
!

↑ Insert the most common viewport meta tag

CSS

            
              .container .gallery ul {
  overflow: hidden;
  *zoom: 1;
}
.container .gallery li {
  width: 21.05263%;
  float: left;
  margin-right: 5.26316%;
  display: inline;
}
.container .gallery li:nth-child(4n) {
  float: right;
  margin-right: 0;
  #margin-left: -1em;
  display: inline;
}
@media (min-width: 59em) {
  .container .gallery li {
    width: 28.57143%;
    float: left;
    margin-right: 7.14286%;
  }
  .container .gallery li:nth-child(4n) {
    float: left;
    margin-right: 1.69492%;
  }
  .container .gallery li:nth-child(3n) {
    float: right;
    margin-right: 0;
  }
}
            
          
!
? ?
? ?
Must be a valid URL.
+ add another resource
via CSS Lint

JS

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