Skip to content

Seasonal Promo Banner with Background Image

Holiday sale banner over a background photo with a dark gradient overlay, falling CSS snow, a copyable coupon code and a call-to-action.

Also known as: holiday sale banner, christmas promo banner, discount coupon banner, falling snow banner, seasonal sale hero

Seasonal Promo Banner with Background Image live demo

Open in new tab

Pure CSS code (HTML, CSS, JS)

A seasonal promo banner in pure CSS that places a holiday sale message, a copyable coupon code and a call-to-action over a full-bleed background photo with gently falling snow. Drop it on a shop home page, a category page or a landing page for Christmas, winter or any other seasonal campaign.

How it works

The root section.spb-banner is a rounded flex container with isolation: isolate. The photo is an img.spb-bg stretched over the whole banner with object-fit: cover; a ::before overlay darkens it for contrast. On phones the overlay is an even dark wash, and from 768 px it fades from nearly opaque on the left to almost clear on the right, so the text reads well while the ornament stays visible. The .spb-snow layer holds twelve dots that fall with the spb-fall keyframes, each with its own position, size, duration and negative delay so the snow is already spread out on the first frame.

The .spb-content column holds the .spb-eyebrow pill with an inline SVG snowflake, the .spb-title with a gold .spb-highlight, the .spb-text, the dashed ticket-style .spb-coupon and the .spb-actions row. The script listens for click on .spb-copy, copies the value of its data-code attribute with the Clipboard API and falls back to a temporary textarea with execCommand('copy') in sandboxed frames. The button then shows "Copied!" for 2.5 seconds and the .spb-status live region confirms it.

Customization

  • data-code on .spb-copy and the text of .spb-code: set your own coupon code; keep both in sync.
  • --spb-overlay on .spb-banner: the overlay color as an RGB triplet, e.g. 8, 20, 40 for a cold winter blue.
  • --spb-gold and --spb-red: the highlight, coupon border and copy button color, and the call-to-action color.
  • data-spb-days on .spb-end: how many days from today the sale ends; the script writes that date into the note.
  • object-position on .spb-bg: moves the focal point of the photo, e.g. 85% center to push the subject further right.
  • Remove the .spb-snow element for non-winter campaigns such as a summer or spring sale.
  • The background photo comes from Unsplash; replace the src of .spb-bg with your own campaign image.

Use cases

  • Online stores: a holiday sale banner over a photo promotes a discount with a clear call to action
  • Winter campaigns: falling snow adds a seasonal feel on top of a dark gradient overlay
  • Email and landing pages: a copyable coupon code lets shoppers grab the offer in one click
  • Seasonal homepages: swap the photo and text to reuse the banner for other events

Accessibility

The banner is a section labelled by its heading. The background photo is decorative, so it has an empty alt and the snow layer is aria-hidden. The copy control is a real button, and the .spb-status paragraph uses role="status" with aria-live="polite" to announce success or a manual-copy hint. Text sits on the dark overlay for strong contrast, and both interactive elements have a white focus outline. With prefers-reduced-motion: reduce the snow stops falling and the hover movements are removed.

Usage notes

Several banners can share a page; the script scopes each one to its own .spb-banner. Without JavaScript the note reads "Ends soon". The clipboard API needs a secure context (HTTPS); on plain HTTP the fallback is used.

Seasonal Promo Banner with Background Image 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
Promo Banners
License
Free for personal and commercial use

Questions about this template

Can I use the Seasonal Promo Banner with Background Image 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.

Seasonal Promo Banner with Background Image – free Pure CSS promo banner template
Seasonal Promo Banner with Background Image · free Pure CSS promo banner template

More Promo Banners

Coupon Ticket – free Pure CSS promo banner template

Coupon Ticket

Ticket-style discount coupon with a striped stub, dashed perforation with notches and a copy code button with clipboard fallback and live feedback.

Promo Banner with Countdown – free Tailwind CSS promo banner template

Promo Banner with Countdown

Dark Tailwind CSS sale banner with a live countdown timer, discount code, call-to-action button and a dismiss control.