Custom Event Setup
×Click on the elements you want to track as custom events. Selected elements will appear in the list below.
.product-card:hover transform: translateY(-6px); box-shadow: 0 22px 32px -12px rgba(0, 0, 0, 0.15); border-color: rgba(80, 140, 200, 0.3);
.product-title font-size: 1.1rem; font-weight: 700; color: #1f2e3c; line-height: 1.3; margin-bottom: 0.5rem;
/* product info */ .product-info padding: 1.25rem 1rem 1.5rem 1rem; flex: 1; display: flex; flex-direction: column; Responsive Product Slider Html Css Codepen
<!-- 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>
/* 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; .product-card:hover transform: translateY(-6px)
<!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;
.btn-add:hover background: #1f6392; border-color: #1f6392; color: white; box-shadow: 0 6px 12px -6px rgba(31,99,146,0.3); box-shadow: 0 22px 32px -12px rgba(0
<!-- Swiper --> <div class="swiper product-swiper"> <div class="swiper-wrapper"> <!-- Product 1 --> <div class="swiper-slide"> <div class="product-card"> <div class="product-img"> <span class="badge">−25%</span> <img src="https://cdn-icons-png.flaticon.com/512/4461/4461320.png" alt="Smart Watch" loading="lazy"> </div> <div class="product-info"> <div class="product-category">Wearables</div> <div class="product-title">AeroSmart Edge</div> <div class="product-desc">Fitness tracker, AMOLED display, 10-day battery life</div> <div class="price-row"> <span class="current-price">$149</span> <span class="old-price">$199</span> </div> <button class="btn-add" aria-label="Add to cart">+ Add to Cart</button> </div> </div> </div>