Copy the HTML from the Source code tab above and paste it inside your <div class="container"> wrapper.
Make sure the Bootstrap 5 CDN CSS and JS are linked in your <head> and before </body>. Any CodeShikhi component assumes Bootstrap 5.3+ is already loaded.
Swap the placeholder text, links, and images for your own content — the layout, spacing, and responsive behaviour stay intact.
The Flash Sale Hero CTA block is fully responsive and works on every screen from 320 px phones to 1440 px+ desktops without additional CSS.
Accessibility checklist
Ship it accessible by default
Use semantic HTML landmarks — <header>, <nav>, <main>, <footer> — so screen readers can navigate your page.
Give every image an alt attribute (empty alt="" if it's decorative).
Label icon-only buttons with aria-label and keep focus outlines visible.
Maintain a contrast ratio of at least 4.5:1 for body text against its background.
Test the flash sale with Tab / Shift+Tab and Enter — every interactive element should be reachable.
Step-by-step customisation
Make it match your brand
Change the colour palette by overriding Bootstrap CSS variables: --bs-primary, --bs-body-bg.
Adjust spacing with utility classes such as py-5, gap-4, and mt-lg-5 — no custom CSS required.
Swap the typography by loading a Google Font in your <head> and setting --bs-body-font-family.
Replace stock images with brand assets. Keep dimensions similar to avoid layout shift.
Preview at multiple breakpoints (mobile, tablet, desktop) and tweak column spans if content wraps awkwardly.
This flash sale is part of the free CodeShikhi (কোড শিখি) Bootstrap 5 library — a growing collection of copy-paste website building blocks curated for learners and freelance developers. Every block is written in clean, semantic HTML with Bootstrap utility classes, keeps custom CSS to the minimum needed, and works without any build step. Use it as a starting point and adapt the markup, colours, and content to fit your project's brand and audience.
If you spot a bug, want a new variation, or would like to contribute an improvement, reach us via the contact page — we ship updates weekly based on community feedback.
Detailed Technical Breakdown
Detailed Technical Breakdown: Flash Sale Hero CTA
Browser compatibility & standards
The Flash Sale Hero CTA flash sale is authored against Bootstrap 5.3, which drops legacy Internet Explorer support and targets modern evergreen engines — Chrome, Edge, Firefox, Safari, and all Chromium-based mobile browsers. Because the markup relies exclusively on the standard CSS features that ship with Bootstrap (Flexbox, CSS Grid, CSS custom properties, and the responsive breakpoint system), you can safely deploy this flash sale to any browser released in the last five years without polyfills. If you need to support very old WebKit or Samsung Internet builds, load the standard Bootstrap 5 CSS from the official jsDelivr CDN — the bundled autoprefixer output already covers those vendor prefixes.
Performance impact
Performance-wise this block is intentionally light. The HTML payload for a typical Bootstrap flash sale is under 4 KB gzipped, and it shares the same Bootstrap CSS/JS bundle you are already loading — meaning the marginal cost of adding it to a page is effectively zero KB on repeat visits. There is no JavaScript framework runtime, no hydration cost, and no client-side data fetching. The only images referenced are placeholders you will replace with your own assets; when you do, serve them as WebP or AVIF, add explicit width and height attributes to prevent layout shift (CLS), and lazy-load anything below the fold with loading="lazy". These small changes typically move Lighthouse Performance scores from the mid-80s into the 95+ range on both mobile and desktop.
Utility classes used
The flash sale leans on Bootstrap's utility-first classes to stay declarative: spacing utilities (p-*, m-*, gap-*), the flex helpers (d-flex, align-items-*, justify-content-*), the grid system (container, row, col-lg-*), typography helpers (display-*, lead, text-*), and colour utilities that resolve to Bootstrap CSS variables such as --bs-primary, --bs-body-bg, and --bs-border-color. Because everything is expressed as utilities you can re-theme the entire flash sale by overriding a handful of CSS variables at the :root level — no Sass recompile required.
Exact customisation steps
Copy the source HTML from the tab above and paste it inside your <body>. The outer <div class="container"> wrapper is already included so the flash sale sits on the Bootstrap grid.
Replace the placeholder headings and paragraphs with your own copy. Keep heading levels in order (h1 → h2 → h3) so screen readers and search engines can parse the document outline.
Swap any <img> tags for your brand assets. Match the original aspect ratio to avoid layout shift, and always fill in a meaningful alt attribute.
Retune the palette by overriding CSS variables::root { --bs-primary: #4f46e5; --bs-body-bg: #ffffff; }. All utility colour classes update automatically.
Test at each Bootstrap breakpoint — sm (576 px), md (768 px),lg (992 px), xl (1200 px), xxl (1400 px) — using your browser's device toolbar, and tweak column spans if long content wraps.
Ship it with the standard Bootstrap 5 CDN in the <head> and the JS bundle before the closing </body>. No build step required.
The hero is your above-the-fold pitch: one headline, one supporting sentence and one primary action. Everything in it is measured by Google's Core Web Vitals because it is almost always the element that defines Largest Contentful Paint. Treat it as a performance budget first and a design canvas second.
Accessibility & ARIA attributes
Keep exactly one <h1> in the hero and let the rest of the page use <h2>/<h3>. If the hero sits on a background image, ensure the text container has a solid or gradient overlay so contrast stays at or above 4.5:1 — use role="img" with an aria-label on decorative image wrappers, and alt="" on purely decorative <img> tags so screen readers skip them. Primary and secondary call-to-action buttons should be real <a> or <button> elements, never clickable <div>s, so keyboard users can reach them with Tab and activate them with Enter or Space.
Performance notes for this pattern
Serve the hero image as AVIF with a WebP fallback and add fetchpriority="high" to it; that single attribute frequently shaves 300–600 ms off LCP on 4G. Always declare width and height (or an aspect-ratio) to keep Cumulative Layout Shift at 0. Avoid autoplaying background video on mobile — it can add several megabytes; use a poster image and load the video only above the lg breakpoint.
Three customisation tricks
Use .display-3 with .lh-1 for a tighter, more editorial headline than the Bootstrap default.
Add a .py-5 .py-lg-6 pairing so vertical rhythm scales up on desktop without custom CSS.
Layer a CSS gradient (linear-gradient) over the background image instead of a separate overlay div — one fewer DOM node and no extra paint.
Mistakes to avoid
Stacking two <h1> tags when the hero already provides the page title.
Using a 4000 px-wide unoptimised JPEG — resize to twice the maximum rendered width, no more.