Ribbon & Badge Creator

Highlight your best products. Visually design diagonal corner ribbons or folded bookmark flags, and generate the pure CSS instantly.

POPULAR

SaaS Pro Plan

Everything you need to scale your application.

$49/mo
<div class="card">
  <div class="ribbon">POPULAR</div>
  ... card content ...
</div>
/* Generated on cssgen.org */

Designing Badges & Ribbons

Whether you are highlighting a discount in an e-commerce store or drawing attention to the "Recommended" tier on a pricing page, ribbons are essential UI elements. However, positioning them correctly without breaking your card layouts can be a headache.

Our generator provides two of the most popular styles. The Diagonal Corner Ribbon uses the transform: rotate() property to slice perfectly across the corner of a container. The Folded Bookmark uses CSS pseudo-elements (the famous border triangle hack) to simulate a physical ribbon wrapping around the back of the card.

🏷️

Pro Tips for Ribbons

  • The Golden Rule of Corner Ribbons: For a diagonal corner ribbon to look correct, its parent container (the card) MUST have position: relative; and overflow: hidden;. If you forget overflow: hidden, the ribbon will stick out past the edges of the card and look broken.
  • The Fold Shadow: When building a folded bookmark, we generate a slightly darker version of your selected background color automatically. We apply this to the ::before pseudo-element using transparent borders to create the 3D folding illusion.
  • Z-Index Management: If your card contains images or other absolutely positioned elements, make sure your ribbon has a high z-index (e.g., z-index: 10;) so it always renders on top of the product photo.

Frequently Asked Questions

How do you make a diagonal corner ribbon in CSS?

First, ensure the parent container has position: relative and overflow: hidden. Then, give the ribbon position: absolute, place it near the top corner (e.g., top: 20px; right: -35px;), and rotate it using transform: rotate(45deg).

How do I create the folded shadow effect on a bookmark ribbon?

The 3D folded effect (where the ribbon wraps around the edge of a container) is created using a ::before pseudo-element. By utilizing the CSS border triangle hack with a darker shade of the ribbon's color, you can draw a small triangle that connects the overhanging ribbon back to the card edge.

Why is my corner ribbon sticking outside the card?

You forgot to add overflow: hidden; to the parent container (the card). Because the ribbon is rotated, its edges physically extend past the boundary of the card. The overflow property clips off those extending edges, making it look flush.