Grid layout with margins only on the middle.
Last active
August 29, 2015 14:01
-
-
Save therako/e3f56c82c0fec3afa1cf to your computer and use it in GitHub Desktop.
A Pen by Arunkumar.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
- for(var i =0; i<10; i++) | |
div.person | |
img(src="http://fc01.deviantart.net/fs7/f/2006/347/b/d/Darth_Vader_by_erwebb.png") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@import "bourbon"; | |
* { | |
box-sizing: boder-box; | |
} | |
body { | |
background: black; | |
} | |
@mixin gridImage($maxImg, $width) { | |
width: ((100% - (($maxImg - 1) * $width))/ $maxImg); | |
margin-right: $width; | |
margin-bottom: $width; | |
&:nth-child(#{$maxImg}n) { | |
margin-right: 0; | |
} | |
} | |
.person { | |
@include gridImage(5, 2%); | |
@media (max-width: 1200px) { | |
@include gridImage(3, 2%); | |
} | |
float: left; | |
background: white; | |
img { | |
max-width: 100% | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment