# Trending Posts Card

> A sidebar widget listing popular posts with large zero-padded numbers drawn by a CSS counter.

- Category: [CSS Cards](https://copy-css.com/category/cards)
- Tags: trending, popular posts, sidebar, numbered list, blog, counter
- Live preview: https://copy-css.com/snippets/trending-posts-card
- License: Free for personal and commercial use. No signup, no attribution required.

## HTML

```html
<section class="trending" aria-labelledby="trending-title">
  <h3 id="trending-title">Trending</h3>
  <ol>
    <li><a href="#">The case for boring CSS</a><span>4 min read</span></li>
    <li><a href="#">Grid or flexbox, a field guide</a><span>6 min read</span></li>
    <li><a href="#">Writing forms people finish</a><span>8 min read</span></li>
  </ol>
</section>
```

## CSS

```css
.trending {
  width: 260px;
  padding: 16px 18px;
  border-radius: 16px;
  background: #fff;
  color: #1c1917;
  font-family: system-ui, sans-serif;
}

.trending h3 {
  margin: 0 0 6px;
  font-size: 13px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.trending ol {
  margin: 0;
  padding: 0;
  list-style: none;
  counter-reset: trending;
}

.trending li {
  display: grid;
  grid-template-columns: 38px 1fr;
  padding: 8px 0;
  border-top: 1px solid #f5f5f4;
  counter-increment: trending;
}

.trending li::before {
  content: counter(trending, decimal-leading-zero);
  grid-row: span 2;
  color: #eab308;
  font-size: 24px;
  font-weight: 800;
  line-height: 1;
}

.trending a {
  color: inherit;
  font-size: 14px;
  font-weight: 600;
  line-height: 1.3;
  text-decoration: none;
}

.trending a:hover {
  text-decoration: underline;
}

.trending a:focus-visible {
  outline: 2px solid #ca8a04;
  outline-offset: 2px;
}

.trending span {
  color: #a8a29e;
  font-size: 12px;
}
```

## Notes

- This CSS Trending Posts Card is 61 lines of pure CSS (1.0 KB) with no JavaScript and no dependencies. It uses CSS Grid and keyboard focus styles.
- In JSX use `className` instead of `class`. In Tailwind projects put the CSS in the global stylesheet.
