Skip to content

Horizontal Card

Three Bootstrap 5 horizontal cards with the image on the left: an article card, a listing card with rating and price, and a compact course card.

Bootstrap 5 Cards Responsive #blog #card #horizontal #listing #responsive

Live preview

Open in new tab

Code

A set of three Bootstrap 5 horizontal cards with the image on the left and content on the right: a blog article card, a listing card with rating, features and price, and a compact course card with a progress bar. Use them in blog indexes, search results, booking sites and learning dashboards.

How it works

The cards sit in .hc-list, a one-column grid limited to 920px. Each article.card.hc-card uses a Bootstrap row g-0: the image column (col-md-5 col-lg-4) contains .hc-media, and the content column contains .hc-body, a flex column that pushes .hc-meta or .hc-footer to the bottom. On phones the columns stack and the image keeps a fixed ratio from --hc-img-ratio. From the md breakpoint the image is positioned absolutely and covers the whole column with object-fit: cover, so it always matches the height of the text.

The article card and the compact card use Bootstrap's stretched-link on the title, so the whole card is clickable. The .hc-card--listing variant has a real button instead, a .hc-badge over the photo, a .hc-rating line and .hc-features pills. The .hc-card--compact variant keeps a small square thumbnail next to the text even on phones. Hovering a card lifts it, deepens the shadow and zooms the image slightly. A small script reads aria-valuenow from each progress bar in .hc-progress, sets the width of .hc-progress__bar and fills .hc-progress__value, so the value is defined in one place.

Customization

  • --hc-accent and --hc-accent-hover in .hc-list: change the kicker, link hover, avatar, button, focus outline and progress color.
  • --hc-img-ratio in .hc-list: set the image ratio of stacked cards on phones, e.g. 4 / 3 or 1 / 1.
  • --hc-radius in .hc-list: make the corners rounder or set 0.5rem for a sharper look.
  • --hc-thumb in .hc-list (phones) and in the .hc-card--compact rule inside the min-width: 576px media query (larger screens): resize the square thumbnail of the compact card.
  • col-md-5 col-lg-4 on the image column and col-md-7 col-lg-8 on the text column: use col-md-4 and col-md-8 for a narrower image on tablets.
  • aria-valuenow="58" on the progress bar: set the course progress; the bar and percentage update on load.
  • background: #e2e8f0 in .hc-media: change the placeholder color shown while images load.

Accessibility

Each card is an article with a heading. Thumbnails that only repeat the title use an empty alt, while the listing photo has descriptive alt text. When a stretched link receives keyboard focus, :has(.stretched-link:focus-visible) draws an outline around the whole card. The rating includes visually hidden "out of 5" text, the date uses a time element, and the progress bar has role="progressbar" with aria-label and value attributes. Icons and initials are aria-hidden. Hover lift and image zoom are disabled with prefers-reduced-motion: reduce.

Usage notes

Requires Bootstrap 5 and Bootstrap Icons. The script is only needed for the progress bar; without it the bar stays empty.

Requirements

Add these to your page (already included in the download):

  • <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.3/dist/css/bootstrap.min.css">
  • <script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.3/dist/js/bootstrap.bundle.min.js"></script>
  • <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap-icons@1.11.3/font/bootstrap-icons.min.css">
Horizontal Card – Bootstrap 5 cards component screenshot
Horizontal Card · Bootstrap 5 Cards

More Cards

Cards with Hover Lift – Pure CSS cards preview

Cards with Hover Lift

Pure CSS blog card grid where each card lifts with a deeper shadow and zooms its image on hover or keyboard focus.

Card with Image Overlay – Bootstrap 5 cards preview

Card with Image Overlay

Bootstrap 5 image cards with text overlaid on photos, a readability gradient, category badges, save buttons and a featured layout.

Blog Post Card – Tailwind CSS cards preview

Blog Post Card

Tailwind CSS blog post card with cover illustration, category badge, date, reading time, clamped excerpt, author row and a fully clickable area.

3D Flip Card – Pure CSS cards preview

3D Flip Card

Three pure CSS 3D flip cards that turn on hover, keyboard focus or tap to reveal details and a link on the back.