Responsive Product Slider Html Css Codepen May 2026

<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=yes"> <title>Responsive Product Slider | Pure HTML/CSS + Swiper (Lightweight)</title> <!-- Google Fonts & simple reset --> <link href="https://fonts.googleapis.com/css2?family=Inter:opsz,wght@14..32,300;14..32,400;14..32,500;14..32,600;14..32,700&display=swap" rel="stylesheet"> <!-- Swiper CSS (modern, touch-optimized, responsive slider) --> <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/swiper@11/swiper-bundle.min.css" /> <style> * margin: 0; padding: 0; box-sizing: border-box;

<!-- 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>

/* image wrapper with aspect ratio */ .product-img position: relative; background: #f4f8fe; padding: 1rem; display: flex; align-items: center; justify-content: center; overflow: hidden; border-bottom: 1px solid #edf2f7; Responsive Product Slider Html Css Codepen

/* 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);

.old-price font-size: 0.85rem; color: #98aec5; text-decoration: line-through; meta name="viewport" content="width=device-width

.section-head h2 font-size: 2.2rem; font-weight: 700; background: linear-gradient(135deg, #1A2A3F, #2C4C6E); background-clip: text; -webkit-background-clip: text; color: transparent; letter-spacing: -0.02em;

/* extra small devices: hide navigation if needed but still touch swipe works */ @media (max-width: 480px) .swiper-button-next, .swiper-button-prev display: none; .product-card border-radius: 1.25rem; !-- Swiper CSS (modern

/* 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);