Skip to content

Instantly share code, notes, and snippets.

@julia-r
Last active March 22, 2018 15:19
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save julia-r/b547a39d3f7109f670318aeaf381a577 to your computer and use it in GitHub Desktop.
Save julia-r/b547a39d3f7109f670318aeaf381a577 to your computer and use it in GitHub Desktop.
CSS Grid
/**
* CSS Grid
*/
.container {
display: grid;
grid-template-columns: repeat(3, 1fr);
grid-template-rows: repeat(5, 1fr);
}
.item:nth-child(2){
grid-column: 2 / 4;
grid-row: 1 / 3;
}
.container {
background-color: lightblue;
width: 100vw;
height: 100vh;
margin: 0;
}
.item {
background-color: blue;
margin: 5px;
color: white;
font-size: 50px;
line-height: 100px;
text-align: center;
font-family: monospace;
}
body {
margin: 0
}
<div class="container">
<div class="item">1</div>
<div class="item">2</div>
<div class="item">3</div>
<div class="item">4</div>
<div class="item">5</div>
<div class="item">6</div>
<div class="item">7</div>
<div class="item">8</div>
<div class="item">9</div>
<div class="item">10</div>
</div>
// alert('Hello world!');
{"view":"split","fontsize":"100","seethrough":"","prefixfree":"1","page":"css"}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment