JSFiddle - React, Tailwind, and code Playground

by ckissi

HTML

<div class="container">
  <div class="item">Item 1</div>
  <div class="item">Item 2</div>
  <div class="item">Item 3</div>
  <!-- Add more items as needed -->
</div>

CSS

.container {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 20px; /* Space between items */
  padding: 20px; /* Padding around the grid */
}

.item {
  background-color: #f0f0f0; /* Light grey background */
  padding: 20px; /* Padding inside each item */
  text-align: center; /* Centering the text */
}