Skip to content

Countdown Timer Cards

Pure CSS countdown with days, hours, minutes and seconds in flip-style cards.

Also known as: flip countdown, deadline countdown timer, days hours minutes seconds countdown, flip clock timer

Pure CSS Countdown Timers Responsive Dark #countdown #launch #timer

Countdown Timer Cards live demo

Open in new tab

Pure CSS code (HTML, CSS, JS)

A dark countdown timer with four flip-style cards for days, hours, minutes and seconds, written in pure CSS and vanilla JavaScript. Use it for sale banners, event pages, webinar registrations or any deadline that should feel urgent.

How it works

The root element is section.cd-timer, which holds a .cd-title heading, the .cd-grid of four .cd-unit cards, a visually hidden live region and a .cd-done message that starts out hidden. Each card contains a .cd-value number with a data-unit attribute (days, hours, minutes or seconds) and a .cd-label caption. A thin ::after line across the middle of every card gives the flip-clock look, and font-variant-numeric: tabular-nums keeps the digits from jumping as they change.

On DOMContentLoaded the script initializes every .cd-timer. It first reads data-countdown as an absolute date. If that is missing or invalid it falls back to data-countdown-days, counting that many days from the moment the page loads (handy for demos), and to 7 days if neither is set. A tick() function runs every second, splits the remaining time into units and writes zero-padded values into the data-unit elements. When the time reaches zero the interval is cleared, .cd-grid is hidden and .cd-done is shown.

Customization

  • data-countdown on .cd-timer: set a real deadline in ISO 8601, e.g. 2026-12-31T23:59:59Z; it takes priority over the demo value.
  • data-countdown-days="30" on .cd-timer: change or remove the relative demo duration.
  • --cd-accent in .cd-timer: changes the color of the large digits.
  • --cd-bg and --cd-card: set the panel background and the card background, for example a light theme with matching --cd-text.
  • --cd-muted: changes the color of .cd-title and the .cd-label captions.
  • Edit the text of .cd-title and .cd-done to match your campaign, such as "Doors open in" and a launch message.
  • grid-template-columns in the @media (max-width: 360px) rule of .cd-grid: controls when the cards wrap into a 2 by 2 grid.
  • font-size: clamp(1.75rem, 8vw, 3rem) on .cd-value: make the digits larger or smaller.

Use cases

  • Sale and promo banners: four flip-style cards count down the days, hours, minutes and seconds until an offer ends
  • Event pages: show visitors exactly how long remains until the doors open
  • Webinar registration pages: build urgency by counting down to the live session start time
  • Several deadlines on one page: each timer keeps its own target date and interval

Accessibility

The ticking cards are marked aria-hidden="true" so screen readers are not flooded with a change every second. Instead the paragraph with data-countdown-summary is an aria-live="polite" region, hidden visually with .cd-sr, that the script updates only when the minute changes, with text such as "12 days, 4 hours and 30 minutes left." The section is labelled by its heading through aria-labelledby="cd-title". Light digits on the dark slate background provide strong contrast, and there are no animations to reduce.

Usage notes

Several timers can share a page; each .cd-timer keeps its own target and interval. Give each instance a unique heading id. The countdown uses the visitor's clock, so use a UTC timestamp in data-countdown for a deadline that is the same for everyone.

Countdown Timer Cards at a glance

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

Questions about this template

Can I use the Countdown Timer Cards 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.

Countdown Timer Cards – free Pure CSS countdown timer template
Countdown Timer Cards · free Pure CSS countdown timer template

More Countdown Timers

Launch Countdown Card – free Bootstrap 5 countdown timer template

Launch Countdown Card

Bootstrap 5 countdown card for product launches with a reminder button.

Circular Countdown Timer – free Pure CSS countdown timer template

Circular Countdown Timer

Countdown timer with glowing SVG rings for days, hours, minutes and seconds that shrink as time runs out. Pure CSS with a small vanilla JS file.

Countdown Sale Banner for Shopify – free Shopify countdown timer template

Countdown Sale Banner for Shopify

A Shopify section that counts down to one fixed end date, as a full banner or slim bar, with an optional discount code to copy and a clean ended state.

Flip Countdown – free Tailwind CSS countdown timer template

Flip Countdown

Tailwind CSS flip-clock countdown timer with 3D split-flap cards for days, hours, minutes and seconds, reduced-motion support and a completion event.