css grid demo - ready for flex content
no fallback for ie11
by ian_smithz
HTML
<div class="support-grid"></div>
<div class="band">
<div class="item item-1">
<a href="https://design.tutsplus.com/articles/international-artist-feature-malaysia--cms-26852" class="card">
<div class="thumb"></div>
<article>
<h1>International Artist Feature: Malaysia</h1>
<span>Mary Winkler</span>
</article>
</a>
</div>
<div class="item item-2">
<a href="https://webdesign.tutsplus.com/articles/how-to-conduct-remote-usability-testing--cms-27045" class="card">
<div class="thumb"></div>
<article>
<h1>How to Conduct Remote Usability Testing</h1>
<span>Harry Brignull</span>
</article>
</a>
</div>
<div class="item item-3">
<a href="https://design.tutsplus.com/articles/envato-tuts-community-challenge-created-by-you-july-edition--cms-26724" class="card">
<div class="thumb"></div>
<article>
<h1>Created by You, July Edition</h1>
<p>Welcome to our monthly feature of fantastic tutorial results created by you, the Envato Tuts+ community! </p>
<span>Melody Nieves</span>
</article>
</a>
</div>
<div class="item item-4">
<a href="https://webdesign.tutsplus.com/tutorials/how-to-code-a-scrolling-alien-lander-website--cms-26826" class="card">
<div class="thumb"></div>
<article>
<h1>How to Code a Scrolling “Alien Lander” Website</h1>
<p>We’ll be putting things together so that as you scroll down from the top of the page you’ll see an “Alien Lander” making its way to touch down.</p>
<span>Kezz Bracey</span>
</article>
</a>
</div>
<div class="item item-5">
<a href="https://design.tutsplus.com/tutorials/stranger-things-inspired-text-effect--cms-27139" class="card">
<div class="thumb"></div>
...
CSS
html {
background: #f5f7f8;
font-family: 'Roboto', sans-serif;
-webkit-font-smoothing: antialiased;
padding: 20px 0;
}
.item {
background-color: #f5f5f5;
}
.band {
width: 90%;
max-width: 1240px;
margin: 0 auto;
border: 1px solid #000;
display: grid;
grid-template-columns: 1fr;
grid-template-rows: auto;
grid-gap: 20px;
}
@media only screen and (min-width: 500px) {
.band {
grid-template-columns: 1fr 1fr;
}
}
@media only screen and (min-width: 850px) {
.band {
grid-template-columns: 1fr 1fr 1fr 1fr;
}
}