← All elements

Corner Ribbon Badge

by @admin · 7 views

<article class="pc-ribbon-card">
  <span class="pc-ribbon">-30%</span>
  <div class="pc-ribbon-card__img"></div>
  <h3>Wool Beanie</h3>
  <p>₱890</p>
</article>

About this card

A product card with a diagonal sale ribbon wrapped around its corner, made from one rotated element and clipped by overflow.

How it works

The ribbon is one wide element positioned at the top right of the card and rotated 45 degrees. The card has overflow: hidden, so the ends of the ribbon are clipped by the card edge and it looks wrapped around the corner. A small shadow on the ribbon lifts it off the card.

Ways to customise it

  • Change #e0245e and the text to make a New or Sold out ribbon.
  • Change top and right to move the ribbon along the corner.
  • Change the 140px width for a longer ribbon.

Good to know

Because the card clips overflow, anything that needs to stick out, such as a drop-down, should live outside it. Do not rely on the ribbon colour alone to say a product is on sale; the percentage text does that.

Open an example, copy the HTML and the CSS, and paste them into your page. There is nothing to install and no JavaScript to load.

More in Cards

View all →