Back to Full Page Component

E-commerce Website Home Page

E-commerce a. Homepage Page:  i. Header Top Section (Offer text, Track Order, Login)  ii. Navigation Section with Logo, Home, Shop, Categories, Cart, Checkout, Dashboard, Contact.  iii. Hero Banner Section (Full wide carousel with offers/sliding).  iv. Category Highlight Section (Circular images).  v. Flash Sale Section (using countdown timer).  vi. Featured Products Section (using bootstrap card).  vii. Big Footer Section (Links, App download, Payment methods).  viii. Footer Bottom Section

#E-commerce Website Home Page#Home Page

Live preview

Source code

html
<div class="container">
  <!-- Content here -->
  <!-- Link to Bootstrap CSS and Icons included via standard CDN as per usage instructions -->

  <!-- TOP HEADER -->
  <div class="bg-dark text-white py-2 small">
    <div class="container d-flex justify-content-between align-items-center">
      <div>
        <span class="me-3"><i class="bi bi- megaphone me-1"></i> Special Offer: Get 20% off on your first order!</span>
      </div>
      <div class="d-none d-md-block">
        <a href="#" class="text-white text-decoration-none me-3"><i class="bi bi-truck me-1"></i> Track Order</a>
        <a href="#" class="text-white text-decoration-none"><i class="bi bi-person me-1"></i> Login / Register</a>
      </div>
    </div>
  </div>

  <!-- NAVIGATION -->
  <nav class="navbar navbar-expand-lg navbar-light bg-white shadow-sm sticky-top">
    <div class="container text-uppercase fw-bold">
      <a class="navbar-brand text-primary fw-bolder fs-3" href="#">SHOP<span class="text-dark">EASE</span></a>
      <button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbarNav">
        <span class="navbar-toggler-icon"></span>
      </button>
      <div class="collapse navbar-collapse" id="navbarNav">
        <ul class="navbar-nav ms-auto align-items-center">
          <li class="nav-item"><a class="nav-link active" href="#">Home</a></li>
          <li class="nav-item"><a class="nav-link" href="#">Shop</a></li>
          <li class="nav-item dropdown">
            <a class="nav-link dropdown-toggle" href="#" data-bs-toggle="dropdown">Categories</a>
            <ul class="dropdown-menu border-0 shadow-sm">
              <li><a class="dropdown-item" href="#">Electronics</a></li>
              <li><a class="dropdown-item" href="#">Fashion</a></li>
              <li><a class="dropdown-item" href="#">Home & Decor</a></li>
            </ul>
          </li>
          <li class="nav-item"><a class="nav-link" href="#">Dashboard</a></li>
          <li class="nav-item"><a class="nav-link" href="#">Contact</a></li>
          <li class="nav-item ms-lg-3">
            <a class="btn btn-outline-dark position-relative rounded-pill px-3" href="#">
              <i class="bi bi-cart3"></i> Cart
              <span class="position-absolute top-0 start-100 translate-middle badge rounded-pill bg-danger">3</span>
            </a>
          </li>
          <li class="nav-item ms-2">
            <a class="btn btn-primary rounded-pill px-3" href="#">Checkout</a>
          </li>
        </ul>
      </div>
    </div>
  </nav>

  <!-- HERO BANNER CAROUSEL -->
  <div id="heroCarousel" class="carousel slide" data-bs-ride="carousel">
    <div class="carousel-indicators">
      <button type="button" data-bs-target="#heroCarousel" data-bs-slide-to="0" class="active"></button>
      <button type="button" data-bs-target="#heroCarousel" data-bs-slide-to="1"></button>
    </div>
    <div class="carousel-inner">
      <div class="carousel-item active bg-light" style="height: 500px; background: url('https://images.unsplash.com/photo-1607082348824-0a96f2a4b9da?auto=format&fit=crop&q=80&w=2070') center/cover;">
        <div class="container h-100 d-flex flex-column justify-content-center text-white">
          <h1 class="display-3 fw-bold mb-3">Summer Collection 2024</h1>
          <p class="fs-4 mb-4">Discover the latest trends in fashion and tech.</p>
          <div>
            <a href="#" class="btn btn-primary btn-lg px-5 rounded-pill">Shop Now</a>
          </div>
        </div>
      </div>
      <div class="carousel-item" style="height: 500px; background: url('https://images.unsplash.com/photo-1441986300917-64674bd600d8?auto=format&fit=crop&q=80&w=2070') center/cover;">
        <div class="container h-100 d-flex flex-column justify-content-center text-white">
          <h1 class="display-3 fw-bold mb-3">Tech Revolution</h1>
          <p class="fs-4 mb-4">Up to 40% off on all electronic gadgets.</p>
          <div>
            <a href="#" class="btn btn-warning btn-lg px-5 rounded-pill text-white fw-bold">View Offers</a>
          </div>
        </div>
      </div>
    </div>
    <button class="carousel-control-prev" type="button" data-bs-target="#heroCarousel" data-bs-slide="prev">
      <span class="carousel-control-prev-icon"></span>
    </button>
    <button class="carousel-control-next" type="button" data-bs-target="#heroCarousel" data-bs-slide="next">
      <span class="carousel-control-next-icon"></span>
    </button>
  </div>

  <!-- CATEGORY HIGHLIGHT SECTION -->
  <section class="py-5 bg-white">
    <div class="container text-center">
      <h2 class="fw-bold mb-5">Shop by Category</h2>
      <div class="row g-4 justify-content-center">
        <div class="col-6 col-md-2">
          <div class="category-circle mx-auto mb-3 shadow-sm overflow-hidden rounded-circle" style="width: 120px; height: 120px;">
            <img src="https://images.unsplash.com/photo-1523275335684-37898b6baf30?w=200" class="w-100 h-100 object-fit-cover" alt="Watches">
          </div>
          <h5>Watches</h5>
        </div>
        <div class="col-6 col-md-2">
          <div class="category-circle mx-auto mb-3 shadow-sm overflow-hidden rounded-circle" style="width: 120px; height: 120px;">
            <img src="https://images.unsplash.com/photo-1542291026-7eec264c27ff?w=200" class="w-100 h-100 object-fit-cover" alt="Shoes">
          </div>
          <h5>Shoes</h5>
        </div>
        <div class="col-6 col-md-2">
          <div class="category-circle mx-auto mb-3 shadow-sm overflow-hidden rounded-circle" style="width: 120px; height: 120px;">
            <img src="https://images.unsplash.com/photo-1491553895911-0055eca6402d?w=200" class="w-100 h-100 object-fit-cover" alt="Fashion">
          </div>
          <h5>Fashion</h5>
        </div>
        <div class="col-6 col-md-2">
          <div class="category-circle mx-auto mb-3 shadow-sm overflow-hidden rounded-circle" style="width: 120px; height: 120px;">
            <img src="https://images.unsplash.com/photo-1505740420928-5e560c06d30e?w=200" class="w-100 h-100 object-fit-cover" alt="Audio">
          </div>
          <h5>Audio</h5>
        </div>
        <div class="col-6 col-md-2">
          <div class="category-circle mx-auto mb-3 shadow-sm overflow-hidden rounded-circle" style="width: 120px; height: 120px;">
            <img src="https://images.unsplash.com/photo-1526170315870-ef6d82f58326?w=200" class="w-100 h-100 object-fit-cover" alt="Gadgets">
          </div>
          <h5>Gadgets</h5>
        </div>
      </div>
    </div>
  </section>

  <!-- FLASH SALE SECTION -->
  <section class="py-5 bg-danger text-white">
    <div class="container">
      <div class="row align-items-center">
        <div class="col-lg-6 mb-4 mb-lg-0">
          <h2 class="fw-bold mb-0">🔥 FLASH SALE IS ON!</h2>
          <p class="mb-0">Hurry up! Grab your favorites before they go out of stock.</p>
        </div>
        <div class="col-lg-6">
          <div class="d-flex justify-content-lg-end gap-3" id="countdown">
            <div class="text-center p-3 bg-white text-danger rounded-3" style="min-width: 80px;">
              <span class="d-block fs-3 fw-bold" id="days">00</span>
              <small class="text-uppercase small">Days</small>
            </div>
            <div class="text-center p-3 bg-white text-danger rounded-3" style="min-width: 80px;">
              <span class="d-block fs-3 fw-bold" id="hours">00</span>
              <small class="text-uppercase small">Hours</small>
            </div>
            <div class="text-center p-3 bg-white text-danger rounded-3" style="min-width: 80px;">
              <span class="d-block fs-3 fw-bold" id="mins">00</span>
              <small class="text-uppercase small">Mins</small>
            </div>
            <div class="text-center p-3 bg-white text-danger rounded-3" style="min-width: 80px;">
              <span class="d-block fs-3 fw-bold" id="secs">00</span>
              <small class="text-uppercase small">Secs</small>
            </div>
          </div>
        </div>
      </div>
    </div>
  </section>

  <!-- FEATURED PRODUCTS -->
  <section class="py-5">
    <div class="container">
      <div class="d-flex justify-content-between align-items-center mb-4">
        <h2 class="fw-bold mb-0">Featured Products</h2>
        <a href="#" class="btn btn-link text-decoration-none">View All Products <i class="bi bi-arrow-right"></i></a>
      </div>
      <div class="row g-4 text-center">
        <!-- Product Card 1 -->
        <div class="col-md-3">
          <div class="card h-100 border-0 shadow-sm rounded-4 product-card overflow-hidden">
            <img src="https://images.unsplash.com/photo-1572635196237-14b3f281503f?w=400" class="card-img-top p-3" alt="Product">
            <div class="card-body">
              <p class="text-muted small mb-1">Eyewear</p>
              <h6 class="fw-bold">Premium Sunglasses</h6>
              <div class="text-primary fw-bold mb-3">$129.00</div>
              <button class="btn btn-dark w-100 rounded-pill"><i class="bi bi-cart-plus me-2"></i>Add to Cart</button>
            </div>
          </div>
        </div>
        <!-- Product Card 2 -->
        <div class="col-md-3">
          <div class="card h-100 border-0 shadow-sm rounded-4 product-card overflow-hidden">
            <img src="https://images.unsplash.com/photo-1584917865442-de89df76afd3?w=400" class="card-img-top p-3" alt="Product">
            <div class="card-body">
              <p class="text-muted small mb-1">Accessories</p>
              <h6 class="fw-bold">Leather Handbag</h6>
              <div class="text-primary fw-bold mb-3">$250.00</div>
              <button class="btn btn-dark w-100 rounded-pill"><i class="bi bi-cart-plus me-2"></i>Add to Cart</button>
            </div>
          </div>
        </div>
        <!-- Product Card 3 -->
        <div class="col-md-3">
          <div class="card h-100 border-0 shadow-sm rounded-4 product-card overflow-hidden">
            <img src="https://images.unsplash.com/photo-1546868801-89930f46dcc2?w=400" class="card-img-top p-3" alt="Product">
            <div class="card-body">
              <p class="text-muted small mb-1">Wearables</p>
              <h6 class="fw-bold">Smart Watch Series 7</h6>
              <div class="text-primary fw-bold mb-3">$399.00</div>
              <button class="btn btn-dark w-100 rounded-pill"><i class="bi bi-cart-plus me-2"></i>Add to Cart</button>
            </div>
          </div>
        </div>
        <!-- Product Card 4 -->
        <div class="col-md-3">
          <div class="card h-100 border-0 shadow-sm rounded-4 product-card overflow-hidden">
            <img src="https://images.unsplash.com/photo-1525966222134-fcfa99b8ae77?w=400" class="card-img-top p-3" alt="Product">
            <div class="card-body">
              <p class="text-muted small mb-1">Footwear</p>
              <h6 class="fw-bold">Classic Sneakers</h6>
              <div class="text-primary fw-bold mb-3">$89.00</div>
              <button class="btn btn-dark w-100 rounded-pill"><i class="bi bi-cart-plus me-2"></i>Add to Cart</button>
            </div>
          </div>
        </div>
      </div>
    </div>
  </section>

  <!-- FOOTER -->
  <footer class="bg-light pt-5 border-top">
    <div class="container">
      <div class="row g-4 mb-5">
        <div class="col-lg-4">
          <h4 class="fw-bold text-primary mb-4">SHOPEASE</h4>
          <p class="text-muted">High-quality products delivered to your doorstep. We are committed to excellence in service and customer satisfaction.</p>
          <div class="d-flex gap-3">
            <a href="#" class="btn btn-outline-dark btn-sm rounded-circle"><i class="bi bi-facebook"></i></a>
            <a href="#" class="btn btn-outline-dark btn-sm rounded-circle"><i class="bi bi-instagram"></i></a>
            <a href="#" class="btn btn-outline-dark btn-sm rounded-circle"><i class="bi bi-twitter-x"></i></a>
          </div>
        </div>
        <div class="col-lg-2">
          <h6 class="fw-bold mb-4">Quick Links</h6>
          <ul class="list-unstyled">
            <li class="mb-2"><a href="#" class="text-muted text-decoration-none small">About Us</a></li>
            <li class="mb-2"><a href="#" class="text-muted text-decoration-none small">Privacy Policy</a></li>
            <li class="mb-2"><a href="#" class="text-muted text-decoration-none small">Terms & Conditions</a></li>
            <li class="mb-2"><a href="#" class="text-muted text-decoration-none small">Refund Policy</a></li>
          </ul>
        </div>
        <div class="col-lg-2">
          <h6 class="fw-bold mb-4">Customer Care</h6>
          <ul class="list-unstyled">
            <li class="mb-2"><a href="#" class="text-muted text-decoration-none small">Contact Support</a></li>
            <li class="mb-2"><a href="#" class="text-muted text-decoration-none small">Shipping Details</a></li>
            <li class="mb-2"><a href="#" class="text-muted text-decoration-none small">Order Tracking</a></li>
            <li class="mb-2"><a href="#" class="text-muted text-decoration-none small">FAQs</a></li>
          </ul>
        </div>
        <div class="col-lg-4">
          <h6 class="fw-bold mb-4">Install App</h6>
          <p class="small text-muted">From App Store or Google Play</p>
          <div class="d-flex gap-2 mb-4">
            <img src="https://upload.wikimedia.org/wikipedia/commons/3/3c/Download_on_the_App_Store_Badge.svg" width="120" alt="App Store">
            <img src="https://upload.wikimedia.org/wikipedia/commons/7/78/Google_Play_Store_badge_EN.svg" width="120" alt="Play Store">
          </div>
          <h6 class="fw-bold mb-3">Secured Payment Gateways</h6>
          <img src="https://upload.wikimedia.org/wikipedia/commons/5/5e/Visa_Inc._logo.svg" height="20" class="me-3 grayscale" alt="Visa">
          <img src="https://upload.wikimedia.org/wikipedia/commons/2/2a/Mastercard-logo.svg" height="20" class="me-3 grayscale" alt="Mastercard">
          <img src="https://upload.wikimedia.org/wikipedia/commons/b/b5/PayPal.svg" height="20" class="grayscale" alt="Paypal">
        </div>
      </div>
    </div>
    <div class="bg-dark text-white py-3 text-center">
      <div class="container">
        <p class="mb-0 small text-secondary">&copy; 2024 ShopEase E-commerce. All rights reserved.</p>
      </div>
    </div>
  </footer>
</div>


<style>
  .product-card {
    transition: transform 0.3s ease, shadow 0.3s ease;
  }

  .product-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1) !important;
  }

  .object-fit-cover {
    object-fit: cover;
  }

  .grayscale {
    filter: grayscale(1);
    opacity: 0.6;
  }

  .category-circle:hover img {
    transform: scale(1.1);
    transition: transform 0.3s ease;
  }

</style>

<script>
  // Simple Countdown Timer Logic
  const countdownDate = new Date();
  countdownDate.setDate(countdownDate.getDate() + 2); // 2 days from now

  setInterval(() => {
    const now = new Date().getTime();
    const distance = countdownDate - now;

    const d = Math.floor(distance / (1000 * 60 * 60 * 24));
    const h = Math.floor((distance % (1000 * 60 * 60 * 24)) / (1000 * 60 * 60));
    const m = Math.floor((distance % (1000 * 60 * 60)) / (1000 * 60));
    const s = Math.floor((distance % (1000 * 60)) / 1000);

    document.getElementById("days").innerText = d.toString().padStart(2, '0');
    document.getElementById("hours").innerText = h.toString().padStart(2, '0');
    document.getElementById("mins").innerText = m.toString().padStart(2, '0');
    document.getElementById("secs").innerText = s.toString().padStart(2, '0');
  }, 1000);

</script>
How to use this component

Add it to your project in three steps

  1. Copy the HTML from the Source code tab above and paste it inside your <div class="container"> wrapper.
  2. 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.
  3. Swap the placeholder text, links, and images for your own content — the layout, spacing, and responsive behaviour stay intact.

The E-commerce Website Home Page 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 component with Tab / Shift+Tab and Enter — every interactive element should be reachable.
Step-by-step customisation

Make it match your brand

  1. Change the colour palette by overriding Bootstrap CSS variables: --bs-primary, --bs-body-bg.
  2. Adjust spacing with utility classes such as py-5, gap-4, and mt-lg-5 — no custom CSS required.
  3. Swap the typography by loading a Google Font in your <head> and setting --bs-body-font-family.
  4. Replace stock images with brand assets. Keep dimensions similar to avoid layout shift.
  5. Preview at multiple breakpoints (mobile, tablet, desktop) and tweak column spans if content wraps awkwardly.

Need the full theory? Read our Bootstrap 5 Technical Introduction Guide for grid, breakpoints, and Sass customisation in depth.

About the E-commerce Website Home Page component

This component 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: E-commerce Website Home Page

Browser compatibility & standards

The E-commerce Website Home Page component 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 component 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 component 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 component 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 component by overriding a handful of CSS variables at the :root level — no Sass recompile required.

Exact customisation steps

  1. 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 component sits on the Bootstrap grid.
  2. Replace the placeholder headings and paragraphs with your own copy. Keep heading levels in order (h1h2h3) so screen readers and search engines can parse the document outline.
  3. 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.
  4. Retune the palette by overriding CSS variables::root { --bs-primary: #4f46e5; --bs-body-bg: #ffffff; }. All utility colour classes update automatically.
  5. 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.
  6. Ship it with the standard Bootstrap 5 CDN in the <head> and the JS bundle before the closing </body>. No build step required.
Technical & Performance Integration Guide

Technical & Performance Integration Guide — E-commerce Website Home Page (component)

When and why to use this component

This block is written as a self-contained Bootstrap 5 section: a single outer container, a predictable grid inside it, and no dependencies beyond the standard Bootstrap CSS and JS bundle. That makes it safe to paste into an existing page without worrying about class-name collisions or cascade conflicts.

Accessibility & ARIA attributes

Keep the heading hierarchy in order, label any icon-only control with aria-label, and give every image either a descriptive alt attribute or an empty alt="" when it is decorative. Interactive elements must be real <button> or <a> tags so they are reachable with Tab and activatable with Enter. If the block includes a collapsible or dismissible element, preserve Bootstrap's data-bs-* attributes — they generate the aria-expanded and aria-controls wiring for you.

Performance notes for this pattern

The markup is under a few kilobytes gzipped and reuses the Bootstrap bundle already on the page, so the marginal cost of adding it is close to zero. Replace placeholder images with optimised WebP or AVIF files, declare width and height to keep Cumulative Layout Shift at zero, and add loading="lazy" to anything that renders below the fold.

Three customisation tricks

  • Override --bs-primary and --bs-body-font-family at :root to rebrand the block without touching its markup.
  • Adjust rhythm with spacing utilities (py-5, gap-4, mt-lg-5) instead of writing custom CSS.
  • Test at every Bootstrap breakpoint and change only the column spans when long copy wraps awkwardly.

Mistakes to avoid

  • Removing the .container wrapper, which makes the content run to the viewport edges.
  • Pasting the block twice on one page when it is meant to appear once.

More designs in this section