Skip to content

Instantly share code, notes, and snippets.

@kmokidd
Created December 22, 2014 12:05
Show Gist options
  • Save kmokidd/00c52cdbf419c4f618b6 to your computer and use it in GitHub Desktop.
Save kmokidd/00c52cdbf419c4f618b6 to your computer and use it in GitHub Desktop.
.image-wall-wrapper{
font-size: 0;
}
.image-wall-wrapper .image-item{
display: inline-block;
background-size: cover;
background-repeat: no-repeat;
/*25% is for 4*4*/
width: 25%;
/*padding-top has the same value to width*/
padding-top: 25%;
/*background is within padding*/
background-clip: padding-box;
/* be center*/
background-position: 50%;
/* the margin between image and image*/
border-bottom: 4px solid transparent;
border-left: 4px solid transparent;
/* border is calculated into width*/
-webkit-box-sizing: border-box;
-moz-box-sizing: border-box;
box-sizing: border-box;
background-image: url(http://qzonestyle.gtimg.cn/aoi/sola/20141222185945_O20XHGAoR2.jpg)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment