Responsive Grid With 3 Lines Of CSS

Responsive Grid With 3 Lines Of CSS

Make a responsive grid with just 3 lines of CSS !

HTML

<div class="grid">
    <div class="one">One</div>
    <div class="two">Two</div>
    <div class="three">Three</div>
    <div class="four">Four</div>
    <div class="five">Five</div>
</div>

CSS

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  grid-gap: 10px;
}

Result