Skip to content

Instantly share code, notes, and snippets.

@v1w3
Created December 27, 2017 15:41
Show Gist options
  • Save v1w3/7991fc7789262ece133547d12370fe34 to your computer and use it in GitHub Desktop.
Save v1w3/7991fc7789262ece133547d12370fe34 to your computer and use it in GitHub Desktop.
CSS3 Grid
<section>
<div>Normal size</div>
<div>Normal size</div>
<div>Double width</div>
<div>Normal size</div>
<div>Double Width</div>
<div>Double Height</div>
<div>Normal size</div>
<div>Normal size</div>
<div>Normal size</div>
<div>Normal size</div>
<div>Double Width</div>
<div>Normal size</div>
<div>Double Width</div>
<div>Normal size</div>
<div>Normal size</div>
</section>
section{
display:grid;
grid-template-columns:repeat(5fr);
grid-gap:10px
}
section div{
background:#401E2A;
height:50vh;
color:#fff;
display:flex;
flex-direction:column;
justify-content:center;
text-align:center
}
section div:nth-child(3){
grid-column:3/5;
grid-row:1;
background:#FF77A8
}
section div:nth-child(5){
grid-column:1/3;
grid-row:2;
background:#FF77A8
}
section div:nth-child(6){
grid-column:3;
grid-row:2/4;
height:210px;
background:#BF597E
}
section div:nth-child(11){
grid-column:4/6;
grid-row:3;
background:#FF77A8
}
section div:nth-child(13){
grid-column:2/4;
grid-row:4;
background:#FF77A8
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment