Responsive Product Card Html Css Codepen May 2026

.old-price font-size: 0.9rem; font-weight: 500; color: #9aaec9; text-decoration: line-through;

<!-- Product Card 4 - Ceramic Mug (minimal) additional responsive demo --> <div class="product-card"> <div class="card-media"> <span class="badge hot">🌱 Eco</span> <img class="product-img" src="https://images.unsplash.com/photo-1514228742587-6b1558fcca3d?w=500&auto=format" alt="Artisan ceramic mug" loading="lazy"> </div> <div class="card-content"> <div class="product-category">Home & Living</div> <h3 class="product-title">Stoneware Mug</h3> <p class="product-description">Handcrafted ceramic, dishwasher safe. Perfect for morning coffee or tea rituals.</p> <div class="rating"> <div class="stars"> <span class="star-filled">★</span><span class="star-filled">★</span><span class="star-filled">★</span><span class="star-filled">★</span><span class="star-empty">★</span> </div> <span class="review-count">(53 reviews)</span> </div> <div class="price-row"> <span class="current-price">$24.90</span> <span class="old-price">$34.90</span> <span class="discount-badge-text">-28%</span> </div> <button class="btn-add" aria-label="Add to cart">☕ Add to cart</button> </div> </div> </div> <div class="container-footer"> <div class="demo-note"> ⚡ Fully responsive product cards | Hover effect | Flex grid | Modern design </div> </div> </div> responsive product card html css codepen

.product-description font-size: 0.85rem; line-height: 1.45; color: #4a5b7a; margin-bottom: 1.3rem; display: -webkit-box; -webkit-line-clamp: 2; line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; .old-price font-size: 0.9rem

/* rating stars (inline flex) */ .rating display: flex; align-items: center; gap: 0.4rem; margin-bottom: 1rem; flex-wrap: wrap; span class="badge hot"&gt

.review-count font-size: 0.7rem; color: #6c7f9e; font-weight: 500;