Skip to content

Instantly share code, notes, and snippets.

@pyrocat101
Last active September 7, 2021 23:58
Show Gist options
  • Save pyrocat101/3ed675efff6d39e637a2ba9b8d5566df to your computer and use it in GitHub Desktop.
Save pyrocat101/3ed675efff6d39e637a2ba9b8d5566df 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, 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