Black Friday bar with promo code in HTML and CSS
A limited-time offer bar: countdown to a fixed date, one-click copyable promo code and a fallback message once the offer is over.
Here is an excerpt of this component's code in HTML and CSS. The full code is free for members, ready to copy into your project.
This component also comes in
The code in HTML and CSS
<!doctype html>
<html lang="fr">
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<title>Bandeau Black Friday avec code promo</title>
<link rel="stylesheet" href="style.css" />
</head>
<body>
<main class="demo">
<div class="bfcr" role="region" aria-label="Offre Black Friday" lang="fr" data-bfcr data-bfcr-end="2026-11-30T23:59:59+01:00">
<div class="bfcr__inner">document.querySelectorAll("[data-bfcr]").forEach((root) => {
const end = new Date(root.dataset.bfcrEnd).getTime();
const live = root.querySelector("[data-bfcr-live]");
const over = root.querySelector("[data-bfcr-expired]");
const timer = root.querySelector("[data-bfcr-timer]");
const sr = root.querySelector("[data-bfcr-sr]");
const copy = root.querySelector("[data-bfcr-copy]");
const label = root.querySelector("[data-bfcr-copy-label]");
const code = root.querySelector("[data-bfcr-code]");
const status = root.querySelector("[data-bfcr-status]");
const digits = Object.fromEntries(["d", "h", "m", "s"].map((key) => [key, root.querySelector(`[data-bfcr-${key}]`)]));
const still = window.matchMedia("(prefers-reduced-motion: reduce)");:root {
--bfcr-bg: #111111;
--bfcr-text: #ffffff;
--bfcr-muted: #d6d3d1;
--bfcr-line: #111111;
--bfcr-accent: #ffcf4a;
--bfcr-accent-hover: #ffe08a;
--bfcr-on-accent: #111111;
--bfcr-cell: rgb(255 255 255 / 0.12);
--bfcr-page-muted: #57534e;
--demo-bg: #faf7f2;
--demo-text: #1c1917;Free component: copy it freely, including for commercial projects.
Other e-commerce components in HTML and CSS
E-commerce components in HTML and CSS
A sales card showing the discount that grows with the cart amount (-10% from €50, -15% from €100…) with a progress bar towards the next tier.
- Tailwind
- React
- CSS
- WordPress

A Christmas gift guide filtered by budget and theme, with the number of ideas announced and an empty state offering to show everything again.
- Tailwind
- React
- CSS
- WordPress

The last order dates for delivery before Christmas, per shipping method, with the days left worked out from the visitor’s date.
- Tailwind
- React
- CSS
- WordPress

A cart that shows live how much is left to add for free shipping, with a progress bar and recalculated totals.
- Tailwind
- React
- CSS
- WordPress

A colour and size picker for a product page: the visual, price and stock follow the choice, and sold-out sizes are disabled.
- Tailwind
- React
- CSS
- WordPress

Wishlist
FreeA wishlist for an online shop: add from product cards, a summary with total and removal, remembered in the browser.
- Tailwind
- React
- CSS
- WordPress