# Article Card

> A vertical blog article card with a cover image, category, clamped excerpt and author line, all one link.

- Category: [CSS Cards](https://copy-css.com/category/cards)
- Tags: blog, article, post, excerpt, author, clickable card
- Live preview: https://copy-css.com/snippets/article-card
- License: Free for personal and commercial use. No signup, no attribution required.

## HTML

```html
<article class="article-card">
  <img src="data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 40 16'%3E%3Crect width='40' height='16' fill='%23a5f3fc'/%3E%3Ccircle cx='29' cy='5' r='3' fill='%23fde047'/%3E%3Cpath d='M0 16v-6l9-4 8 5 7-3 16 8z' fill='%230d9488'/%3E%3Cpath d='M0 16l14-4 10 2 7-1 9 3z' fill='%23115e59'/%3E%3C/svg%3E" alt="" width="250" height="100">
  <div class="article-card-body">
    <p class="article-card-cat">Engineering</p>
    <h3><a href="#">How we cut our CSS bundle in half</a></h3>
    <p class="article-card-excerpt">A practical look at cascade layers, container queries and finally deleting old code.</p>
    <p class="article-card-meta">Rae Tan · Oct 4 · 7 min read</p>
  </div>
</article>
```

## CSS

```css
.article-card {
  position: relative;
  width: 250px;
  overflow: hidden;
  border-radius: 16px;
  background: #fff;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.08);
  color: #0f172a;
  font-family: system-ui, sans-serif;
  transition: box-shadow 0.2s ease, transform 0.2s ease;
}

.article-card:hover {
  box-shadow: 0 14px 30px -12px rgba(15, 23, 42, 0.25);
  transform: translateY(-3px);
}

.article-card img {
  display: block;
  width: 100%;
  height: auto;
}

.article-card-body {
  padding: 12px 16px 16px;
}

.article-card-cat {
  margin: 0;
  color: #0d9488;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.article-card h3 {
  margin: 4px 0 6px;
  font-size: 16px;
  line-height: 1.3;
}

.article-card h3 a {
  color: inherit;
  text-decoration: none;
}

.article-card h3 a::after {
  content: "";
  position: absolute;
  inset: 0;
}

.article-card:has(a:focus-visible) {
  outline: 3px solid #0d9488;
  outline-offset: 3px;
}

.article-card h3 a:focus-visible {
  outline: none;
}

.article-card-excerpt {
  display: -webkit-box;
  margin: 0 0 10px;
  overflow: hidden;
  color: #475569;
  font-size: 13px;
  line-height: 1.5;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.article-card-meta {
  margin: 0;
  color: #94a3b8;
  font-size: 12px;
}

@media (prefers-reduced-motion: reduce) {
  .article-card {
    transition: none;
  }

  .article-card:hover {
    transform: none;
  }
}
```

## Notes

- This CSS Article Card is 88 lines of pure CSS (1.4 KB) with no JavaScript and no dependencies. It uses transitions, transforms, box shadows and the :has() selector.
- the :has() selector: Chrome 105+, Safari 15.4+, Firefox 121+.
- In JSX use `className` instead of `class`. In Tailwind projects put the CSS in the global stylesheet.
