Cart 0

Responsive Product Slider Html Css Codepen -

<!-- Product 8 --> <div class="swiper-slide"> <div class="product-card"> <div class="product-img"> <span class="badge">−20%</span> <img src="https://cdn-icons-png.flaticon.com/512/1623/1623684.png" alt="Mechanical Keyboard" loading="lazy"> </div> <div class="product-info"> <div class="product-category">Gaming</div> <div class="product-title">TypeMaster Pro</div> <div class="product-desc">RGB backlit, hot-swappable, compact 75%</div> <div class="price-row"> <span class="current-price">$119</span> <span class="old-price">$149</span> </div> <button class="btn-add" aria-label="Add to cart">+ Add to Cart</button> </div> </div> </div> </div>

/* main container */ .slider-container max-width: 1400px; width: 100%; margin: 0 auto; background: rgba(255,255,255,0.4); backdrop-filter: blur(0px); border-radius: 2.5rem; padding: 2rem 1rem 2.5rem 1rem; box-shadow: 0 20px 35px -12px rgba(0,0,0,0.08);

body background: linear-gradient(145deg, #f6f9fc 0%, #eef2f5 100%); font-family: 'Inter', sans-serif; padding: 2rem 1rem; display: flex; flex-direction: column; align-items: center; justify-content: center; min-height: 100vh;

/* responsive adjustments */ @media (max-width: 768px) .slider-container padding: 1.5rem 0.5rem 2rem 0.5rem; .section-head h2 font-size: 1.7rem; .product-title font-size: 0.95rem; .current-price font-size: 1.25rem; .swiper-button-next, .swiper-button-prev width: 36px; height: 36px; .swiper-button-next:after, .swiper-button-prev:after font-size: 1rem; Responsive Product Slider Html Css Codepen

<!-- Product 7 --> <div class="swiper-slide"> <div class="product-card"> <div class="product-img"> <img src="https://cdn-icons-png.flaticon.com/512/4343/4343920.png" alt="Sunglasses" loading="lazy"> </div> <div class="product-info"> <div class="product-category">Fashion</div> <div class="product-title">Aero Polarized</div> <div class="product-desc">UV400 protection, lightweight TR90 frame</div> <div class="price-row"> <span class="current-price">$45</span> <span class="old-price">$65</span> </div> <button class="btn-add" aria-label="Add to cart">+ Add to Cart</button> </div> </div> </div>

.swiper-pagination-bullet-active background: #1f6392; opacity: 1; width: 24px; border-radius: 10px;

/* Swiper custom styling */ .product-swiper width: 100%; padding: 0.5rem 0.2rem 2rem 0.2rem; !-- Product 8 --&gt

<!-- Product 5 --> <div class="swiper-slide"> <div class="product-card"> <div class="product-img"> <img src="https://cdn-icons-png.flaticon.com/512/1046/1046784.png" alt="Ceramic Mug" loading="lazy"> </div> <div class="product-info"> <div class="product-category">Home & Living</div> <div class="product-title">Zen Stone Mug</div> <div class="product-desc">Handcrafted ceramic, heat-retaining, 350ml</div> <div class="price-row"> <span class="current-price">$24</span> <span class="old-price">$32</span> </div> <button class="btn-add" aria-label="Add to cart">+ Add to Cart</button> </div> </div> </div>

/* Swiper navigation + pagination custom */ .swiper-button-next, .swiper-button-prev background: white; width: 44px; height: 44px; border-radius: 60px; box-shadow: 0 6px 14px rgba(0,0,0,0.08); transition: all 0.2s; backdrop-filter: blur(4px); border: 1px solid rgba(255,255,255,0.7);

/* product card design */ .product-card background: white; border-radius: 1.75rem; overflow: hidden; width: 100%; display: flex; flex-direction: column; transition: all 0.3s cubic-bezier(0.2, 0, 0, 1); box-shadow: 0 12px 26px -8px rgba(0, 0, 0, 0.08); border: 1px solid rgba(255,255,255,0.5); backdrop-filter: blur(2px); button class="btn-add" aria-label="Add to cart"&gt

.product-img img width: 100%; max-width: 220px; height: auto; aspect-ratio: 1 / 0.95; object-fit: contain; transition: transform 0.4s ease; display: block; margin: 0 auto;

/* product info */ .product-info padding: 1.25rem 1rem 1.5rem 1rem; flex: 1; display: flex; flex-direction: column;

.product-card:hover .product-img img transform: scale(1.02);

/* badge / discount */ .badge position: absolute; top: 16px; left: 16px; background: #e73c3c; color: white; font-size: 0.7rem; font-weight: 700; padding: 0.25rem 0.7rem; border-radius: 40px; letter-spacing: 0.3px; box-shadow: 0 2px 8px rgba(0,0,0,0.1); backdrop-filter: blur(2px); z-index: 2;