# Blog Post Card

> A compact article card with a thumbnail, tag and meta line, where the whole card is one link.

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

## HTML

```html
<article class="post-card">
  <div class="post-thumb"></div>
  <div class="post-body">
    <span class="post-tag">Design</span>
    <h3><a href="#">Ten rules for calmer interfaces</a></h3>
    <p>Mar 12 · 5 min read</p>
  </div>
</article>
```

## CSS

```css
.post-card {
  position: relative;
  display: flex;
  align-items: center;
  gap: 14px;
  max-width: 340px;
  padding: 10px;
  border: 1px solid #e4e4e7;
  border-radius: 16px;
  background: #fff;
  font-family: system-ui, sans-serif;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.post-card:hover {
  border-color: #d4d4d8;
  box-shadow: 0 12px 24px -14px rgba(0, 0, 0, 0.3);
}

.post-card:has(a:focus-visible) {
  outline: 2px solid #7c3aed;
  outline-offset: 2px;
}

/* Use an <img> here in real projects */
.post-thumb {
  flex: none;
  width: 88px;
  height: 88px;
  border-radius: 10px;
  background: #e4e4e7;
  object-fit: cover;
}

.post-tag {
  color: #7c3aed;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.post-body h3 {
  margin: 4px 0 6px;
  font-size: 15px;
  line-height: 1.3;
}

.post-body a {
  color: #18181b;
  text-decoration: none;
  outline: none;
}

/* Stretch the link over the whole card */
.post-body a::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
}

.post-body p {
  margin: 0;
  color: #71717a;
  font-size: 12px;
}
```

## Notes

- This CSS Blog Post Card is 67 lines of pure CSS (1.1 KB) with no JavaScript and no dependencies. It uses transitions, box shadows, Flexbox 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.
