HTML Formatterhtmlformatteronline.com

Article card

A blog post card with cover image, category, date and reading time.

cardarticleblogcontentgrid
<div class="grid">

  <article class="post">
    <a class="cover" href="/journal/linen-care/">
      <img src="https://placehold.co/800x450/e8ecf4/8593ab?text=Linen+care" alt="">
    </a>
    <div class="body">
      <a class="tag" href="/journal/care/">Care</a>
      <h3><a href="/journal/linen-care/">How to wash linen without ruining it</a></h3>
      <p class="excerpt">Linen softens with every wash, as long as you keep it away from the two things that
      destroy it. Neither is the washing machine.</p>
      <footer class="meta">
        <img class="avatar" src="https://placehold.co/64x64/3b4fe4/ffffff?text=RE" alt="">
        <span class="who">Ruth Ellery</span>
        <span class="dot">·</span>
        <time datetime="2026-04-02">2 April</time>
        <span class="dot">·</span>
        <span>5 min read</span>
      </footer>
    </div>
  </article>

  <article class="post">
    <a class="cover" href="/journal/wool-summer/">
      <img src="https://placehold.co/800x450/e6efe9/7ba88f?text=Wool+in+summer" alt="">
    </a>
    <div class="body">
      <a class="tag" href="/journal/cloth/">Cloth</a>
      <h3><a href="/journal/wool-summer/">Wool is a summer fabric, actually</a></h3>
      <p class="excerpt">Everything you were told about wool being for winter comes from one specific kind of
      wool, and it is not the one worth wearing in July.</p>
      <footer class="meta">
        <img class="avatar" src="https://placehold.co/64x64/1f8a5b/ffffff?text=JM" alt="">
        <span class="who">Jon Maher</span>
        <span class="dot">·</span>
        <time datetime="2026-03-18">18 March</time>
        <span class="dot">·</span>
        <span>7 min read</span>
      </footer>
    </div>
  </article>

</div>

How it works

The cover image alt is empty, on purpose. The headline immediately below says the same thing, and the image is a link to the same place. An alt repeating the headline means a screen reader user hears the title twice in a row. alt="" marks it decorative and it is skipped. The same reasoning applies to the avatar — the author's name is written next to it.

margin-top: auto on the byline pushes it to the bottom of the card regardless of how long the headline and excerpt are, so bylines line up across a row. This is the flexbox equivalent of the sticky-footer trick.

The zoom is on the image, not the card. overflow: hidden on the card plus transform: scale() on the image gives the effect without the card itself moving, which would nudge its neighbours.

A real time element. <time datetime="2026-04-02"> carries the machine-readable date while showing whatever human format you like. Search engines and feed readers use the attribute.

Accessibility notes

The whole card is not a link. Only the image, the tag and the headline are. Wrapping an entire card in an anchor means a screen reader reads the full text as one enormous link name, and it makes the category tag unreachable because you cannot nest links.

If you want the whole card clickable, the usual technique is a pseudo-element stretched over the card from the headline link, with the tag raised above it using position: relative.

Making it yours

auto-fit here rather than auto-fill: with two cards, auto-fit stretches them to fill the row while auto-fill would leave a gap where a third would go. For a feed with an unpredictable number of posts, auto-fit is usually what you want.

For a featured post, give the first card grid-column: 1 / -1 and switch its body to a two-column layout.

Add Article structured data to the post pages themselves — not to the cards, which are only links.

Related templates

Check your version

Once you have edited this, the HTML validator will catch any tag you left unclosed, and the formatter will tidy the indentation. Both run in your browser.