What is the CSS Ribbon Generator?
Generate CSS corner ribbon badges - the "New", "Sale", or "Featured" banners that fold across element corners. Copy CSS and HTML.
Everything runs locally in your browser. Adjust the controls above, preview instantly, and copy clean, production-ready CSS — no account, no upload.
Using the CSS Ribbon Generator
Everything lives in the panel at the top of this page. There is nothing to install — it all runs right here in your browser.
Set ribbon text and colour
Enter the label ("New", "Sale", "Featured") and pick a background colour. The preview shows the ribbon on a sample card.
Choose corner position
Pick top-right (most common), top-left, bottom-right, or bottom-left. The transform rotation adjusts automatically.
Copy CSS and HTML
Click Copy to get the ribbon element HTML and the complete CSS including the container overflow rules.
What the generated code looks like
Clean, production-ready CSS — no vendor bloat, no unnecessary declarations.
.ribbon-container {
position: relative;
overflow: hidden;
}
.ribbon {
position: absolute;
top: 16px;
right: -32px;
width: 120px;
padding: 6px 0;
background: #6C2EF5;
color: white;
font-size: 0.75rem;
font-weight: 700;
text-align: center;
transform: rotate(45deg);
box-shadow: 0 2px 8px rgba(0,0,0,0.2);
letter-spacing: 0.05em;
}overflow: hidden on the container is required to clip the rotated ribbon to the card corners.
Pro tips for better results
overflow: hidden on the parent is essential
The ribbon is rotated and extends outside the card. Without overflow: hidden on the card container, the ribbon extends visibly beyond the card edges.
Keep ribbon text under 8 characters
Longer text does not fit the diagonal ribbon width at typical card sizes. Use single words: "Sale", "New", "Hot", "Beta".
Use z-index to ensure the ribbon appears above card content
The card image or content may stack above the ribbon. Add z-index: 1 to the ribbon element to ensure it renders on top.
Frequently asked questions
From the blog
Read more →CSS Box Shadow: A Complete Guide with Examples (2026)
Master CSS box-shadow: every value explained, layering multiple shadows for realistic depth, inset shadows, the spread trick, and copy-paste examples for cards, buttons, and more.
How to Create Glassmorphism in CSS: The Complete 2026 Guide
Learn how to build the frosted-glass effect with CSS backdrop-filter. Real code, the accessibility traps nobody mentions, browser support, and performance tips from production.
The Complete Guide to CSS Gradients (2026)
Master linear, radial, and conic CSS gradients. Learn color stops, angles, hard stops for stripes, multi-layer gradients, and the tricks behind smooth, professional results.