Skip to content

Event Card with Photo and Date Badge

Pure CSS event cards with a cover photo, ticket-stub date badge, category chip, time and venue details, price and a ticket button.

Also known as: event listing card, ticket style date badge, concert event card, event calendar card

Pure CSS Cards Responsive #card #date #event #photo #responsive

Event Card with Photo and Date Badge live demo

Open in new tab

Pure CSS code (HTML, CSS, JS)

A set of event cards built with pure CSS and a tiny script. Each card combines a cover photo, a dark ticket-stub date badge that overlaps the image, a category chip, time and venue details, a price and a ticket button. Use it for concert listings, conference schedules, meetups, workshops or local event calendars.

How it works

The root section.ev-events holds a heading row (.ev-head with a "View all events" link) and an .ev-grid that shows one column on phones, two from 640px and three from 960px. Every article.ev-card is a flex column with four parts:

  1. .ev-media keeps the photo at a fixed ratio with aspect-ratio: var(--ev-photo-ratio), and .ev-img fills it with object-fit: cover. One or two .ev-chip labels sit on top of the photo; .ev-chip--alert moves to the right corner in the accent color.
  2. time.ev-date carries a machine-readable datetime value and shows .ev-month, .ev-day and .ev-weekday. A negative top margin pulls it up over the photo. Its ::before and ::after pseudo-elements are two small circles in the card color, which cut notches into the sides next to the dashed line and turn the badge into a ticket stub.
  3. .ev-body contains the .ev-title and an .ev-meta list with inline SVG clock and pin icons.
  4. .ev-foot uses margin-top: auto, so the price and the .ev-ticket button line up at the bottom of every card even when titles wrap to different lengths.

On hover or focus (:focus-within) the card lifts and the photo zooms slightly. On DOMContentLoaded, script.js sets each badge to today plus data-ev-days, so the sample events always lie ahead; without JavaScript the static month and day remain.

Customization

  • --ev-accent and --ev-accent-hover on .ev-events: the color of buttons, icons, the alert chip and links, e.g. a teal #0f766e.
  • --ev-date-bg and --ev-date-text: the date badge colors; use the accent color for a brighter badge.
  • --ev-photo-ratio: the image shape, e.g. 4 / 3 for taller photos or 21 / 9 for slim banners.
  • data-ev-days, data-ev-dow and data-ev-time on .ev-date: days from today, the weekday to round up to (0 = Sunday) and the start time; remove data-ev-days for a fixed date.
  • --ev-card: the card background, also used by the notch circles.
  • Add .ev-chip--alert to a second chip for states like "Sold out" or "Few seats left".
  • grid-template-columns in the .ev-grid media queries: switch to four columns on very wide layouts.

Use cases

  • Concert and festival listings: cover photo, ticket-stub date and price sit together in each card
  • Conference schedules: cards show time, venue and a ticket button for every session
  • Meetups and workshops: category chips and date badges make small events easy to scan
  • Local event calendars: a responsive grid lists upcoming events with a View all link

Accessibility

Each card is an article labelled by its title through aria-labelledby. The date uses a time element with an ISO datetime, so assistive technology and search engines read the exact date. Icons are aria-hidden, and visually hidden .ev-sr text adds "Time:" and "Venue:" for screen readers. Every ticket link has an aria-label that includes the event name. Links get a clear :focus-visible outline in --ev-focus. Colors meet WCAG AA, and prefers-reduced-motion: reduce turns off the lift and zoom effects.

Usage notes

The photos come from Unsplash and should be replaced with your own event images.

Event Card with Photo and Date Badge at a glance

Framework
Pure CSS
Code
HTML, CSS, JavaScript
JavaScript
Vanilla JavaScript, no jQuery
Dependencies
None
Layout
Responsive, works on mobile
Category
Cards
License
Free for personal and commercial use

Questions about this template

Can I use the Event Card with Photo and Date Badge code for free?

Yes. You can copy or download the code and use it in personal and commercial projects, including client work. No sign-up is needed. Reselling it as part of a component library or template collection is not allowed; see the license.

How do I add it to my website?

There is nothing to install. Paste the HTML where the component should appear, add the CSS to your stylesheet and load the JavaScript before the closing </body> tag. Download HTML gives you a complete page with everything already linked.

Does it need jQuery or a JavaScript framework?

No. The script is plain vanilla JavaScript, so it works without jQuery, React or Vue. You can still use the markup inside those frameworks.

Does it work on mobile?

Yes. The layout adapts to small screens. Use the Mobile and Tablet buttons above the live demo to check it at phone and tablet width.

Requirements

No dependencies. Pure HTML, CSS and JavaScript.

Event Card with Photo and Date Badge – Pure CSS cards component screenshot
Event Card with Photo and Date Badge · Pure CSS Cards

More Cards

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.

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.

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.

Glassmorphism Card – Tailwind CSS cards preview

Glassmorphism Card

Frosted glass profile card in Tailwind CSS with backdrop blur, a light reflection and a follow button over colorful animated gradient blobs.

Interactive Card with Hover Lift – Bootstrap 6 cards preview

Interactive Card with Hover Lift

Bootstrap 6 clickable learning path cards that lift with a soft shadow on hover and keyboard focus, using hover-lift, stretched links and a level filter.

Card with Image Overlay Text – Bootstrap 6 cards preview

Card with Image Overlay Text

Dark Bootstrap 6 travel cards with headline, place and price set over full-bleed photos, a gradient scrim for readability, save buttons and a Toast.