Created
January 24, 2017 03:19
-
-
Save ahmadpriatama/196aa38a6646fffa9e643a25cdac6388 to your computer and use it in GitHub Desktop.
Gallery
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
<div class="container two"> | |
<div class="child"> | |
</div> | |
<div class="child"> | |
</div> | |
<div class="child"> | |
</div> | |
<div class="child"> | |
</div> | |
</div> | |
<br /> | |
<div class="container three"> | |
<div class="child"> | |
</div> | |
<div class="child"> | |
</div> | |
<div class="child"> | |
</div> | |
<div class="child"> | |
</div> | |
</div> |
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
.container { | |
height: 496px; | |
width: 628px; | |
padding: 10px; | |
background-color: gray; | |
.child { | |
display: inline-block; | |
float: left; | |
} | |
.child:nth-child(1) { | |
background-color: red; | |
} | |
.child:nth-child(2) { | |
background-color: green; | |
} | |
.child:nth-child(3) { | |
background-color: blue; | |
} | |
.child:nth-child(4) { | |
background-color: white; | |
} | |
&.two { | |
.child:nth-child(1) { | |
width: 376px; | |
height: 496px; | |
margin-right: 8px; | |
} | |
.child:nth-child(2), .child:nth-child(3) { | |
width: 244px; | |
height: 244px; | |
margin-bottom: 8px; | |
} | |
.child:nth-child(3) { | |
margin-bottom: 0px; | |
} | |
.child:nth-child(4) { | |
display: none; | |
} | |
} | |
&.three { | |
.child:nth-child(1) { | |
width: 460px; | |
height: 496px; | |
margin-right: 8px; | |
} | |
.child:nth-child(2), .child:nth-child(3), .child:nth-child(4) { | |
width: 160px; | |
height: 160px; | |
margin-bottom: 8px; | |
} | |
.child:nth-child(4) { | |
margin-bottom: 0px; | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment