{
  "id": "subgrid-cards",
  "name": "Subgrid Card Alignment",
  "category": "layouts",
  "tags": [
    "subgrid",
    "grid",
    "cards",
    "align",
    "equal height"
  ],
  "description": "Cards side by side whose titles, text and buttons line up across the row, thanks to subgrid.",
  "url": "https://copy-css.com/snippets/subgrid-cards",
  "markdown": "https://copy-css.com/snippets/subgrid-cards.md",
  "html": "<div class=\"sub-cards\">\n  <article>\n    <h3>Fast</h3>\n    <p>Pages load in under a second.</p>\n    <a href=\"#\">Learn more</a>\n  </article>\n  <article>\n    <h3>Secure by default</h3>\n    <p>Encrypted at rest and in transit, with audit logs.</p>\n    <a href=\"#\">Learn more</a>\n  </article>\n</div>",
  "css": ".sub-cards {\n  display: grid;\n  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));\n  gap: 16px;\n  font-family: system-ui, sans-serif;\n}\n\n/* Each card spans 3 rows and shares them with its neighbours */\n.sub-cards > * {\n  display: grid;\n  grid-row: span 3;\n  grid-template-rows: subgrid;\n  row-gap: 10px;\n  padding: 16px;\n  border: 1px solid #bbf7d0;\n  border-radius: 14px;\n  background: #fff;\n}\n\n.sub-cards h3 {\n  margin: 0;\n  color: #14532d;\n  font-size: 17px;\n  line-height: 1.25;\n}\n\n.sub-cards p {\n  margin: 0;\n  color: #4b5563;\n  font-size: 14px;\n  line-height: 1.45;\n}\n\n.sub-cards a {\n  align-self: end;\n  padding: 9px;\n  border-radius: 8px;\n  background: #16a34a;\n  color: #fff;\n  font-size: 14px;\n  font-weight: 600;\n  text-align: center;\n  text-decoration: none;\n}",
  "features": [
    "subgrid",
    "CSS Grid"
  ],
  "customProperties": []
}
