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 →Modern CSS techniques every developer should know
A practical tour of the CSS features that replaced yesterday’s hacks.
From design to code without the friction
How visual generators speed up the build without sacrificing clean output.
Writing CSS that scales with your project
Tokens, naming, and structure that keep large stylesheets maintainable.