# Sale Product Card

> A product card for discounts, with a percent-off badge, crossed-out old price and a low-stock meter.

- Category: [CSS Cards](https://copy-css.com/category/cards)
- Tags: sale, discount, badge, strikethrough price, low stock, ecommerce
- Live preview: https://copy-css.com/snippets/sale-product-card
- License: Free for personal and commercial use. No signup, no attribution required.

## HTML

```html
<article class="sale-card">
  <div class="sale-card-media">
    <img src="data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 40 25'%3E%3Crect width='40' height='25' fill='%23ffe4e6'/%3E%3Cpath d='M13 16v-3a7 7 0 0 1 14 0v3' fill='none' stroke='%23be123c' stroke-width='2.2'/%3E%3Crect x='11' y='14' width='5' height='7' rx='2' fill='%23e11d48'/%3E%3Crect x='24' y='14' width='5' height='7' rx='2' fill='%23e11d48'/%3E%3C/svg%3E" alt="Red wireless headphones" width="200" height="125">
    <span class="sale-card-badge">−30%</span>
  </div>
  <h3><a href="#">Wireless Headphones</a></h3>
  <p class="sale-card-price"><ins>$139</ins> <del>$199</del></p>
  <p class="sale-card-stock" style="--left: 15%">Only 3 left</p>
</article>
```

## CSS

```css
.sale-card {
  width: 200px;
  padding: 10px 10px 14px;
  border-radius: 16px;
  background: #fff;
  color: #18181b;
  font-family: system-ui, sans-serif;
}

.sale-card-media {
  position: relative;
  margin-bottom: 10px;
}

.sale-card-media img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 10px;
}

.sale-card-badge {
  position: absolute;
  top: 8px;
  left: 8px;
  padding: 3px 8px;
  border-radius: 6px;
  background: #e11d48;
  color: #fff;
  font-size: 12px;
  font-weight: 800;
}

.sale-card h3 {
  margin: 0 4px;
  font-size: 14px;
  font-weight: 600;
}

.sale-card h3 a {
  color: inherit;
  text-decoration: none;
}

.sale-card h3 a:focus-visible {
  outline: 2px solid #e11d48;
  outline-offset: 2px;
}

.sale-card-price {
  margin: 4px 4px 8px;
}

.sale-card-price ins {
  color: #e11d48;
  font-size: 18px;
  font-weight: 800;
  text-decoration: none;
}

.sale-card-price del {
  color: #a1a1aa;
  font-size: 13px;
}

.sale-card-stock {
  margin: 0 4px;
  color: #be123c;
  font-size: 12px;
  font-weight: 600;
}

.sale-card-stock::after {
  content: "";
  display: block;
  height: 5px;
  margin-top: 5px;
  border-radius: 999px;
  background: linear-gradient(90deg, #e11d48 var(--left, 20%), #ffe4e6 0);
}
```

## Notes

- This CSS Sale Product Card is 80 lines of pure CSS (1.2 KB) with no JavaScript and no dependencies. It uses linear gradients, keyboard focus styles and custom properties.
- In JSX use `className` instead of `class`. In Tailwind projects put the CSS in the global stylesheet.
