Skip to content

Instantly share code, notes, and snippets.

@pyrocat101
Created September 8, 2021 00:24
Show Gist options
  • Save pyrocat101/eb8c6cb494f59fef7cf390e213cc32e3 to your computer and use it in GitHub Desktop.
Save pyrocat101/eb8c6cb494f59fef7cf390e213cc32e3 to your computer and use it in GitHub Desktop.
Grid
/**
* Grid
*/
* {
margin: 0;
padding: 0;
box-sizing: border-box;
}
#container {
padding: 16px;
width: 100%;
display: grid;
grid-template-columns: repeat(auto-fit, minmax(200px, 240px));
grid-gap: 16px;
}
@media only screen and (max-width: 1280px) {
#container {
grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
}
}
.item {
height: 100px;
border-radius: 8px;
}
<div id="container">
<div class="item" style="background: #F3B3A6"></div>
<div class="item" style="background: #B98B82"></div>
<div class="item" style="background: #E4959E"></div>
<div class="item" style="background: #37515F"></div>
<div class="item" style="background: #1F0812"></div>
</div>
// alert('Hello world!');
{"view":"split","fontsize":"100","seethrough":"","prefixfree":"1","page":"all"}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment