CSS Ribbon Generator
Create corner ribbons for cards — a diagonal "New" / "Sale" banner in any corner with custom text and colors, plus copy-ready HTML + CSS. Free.
💡 How to use
- A corner ribbon is a diagonal banner across a card corner — great for "New", "Sale", or "Featured".
- The parent card needs
position: relativeandoverflow: hidden. - Copy the HTML and CSS, then place the ribbon inside any card.
Free CSS Ribbon Generator
Create corner ribbons with CSS and copy the code in one click. Add a diagonal banner like 'New', 'Sale', or 'Featured' to any card — choose the corner, text, and colors with a live preview, then paste ready-to-use HTML and CSS. Free, no sign-up, runs in your browser.
What is a CSS ribbon?
A corner ribbon is a diagonal banner that sits across the corner of a card or box, used to draw attention to a label such as 'New', 'Sale', 'Featured', or 'Popular'. It is a purely decorative CSS effect — a rotated element clipped to the card's corner — so it needs no images and stays sharp at any size. This generator builds one and lets you place it in any of the four corners.
How to use the ribbon generator
It is instant:
- Type the ribbon text (keep it short — a word or two).
- Choose which corner it sits in.
- Set the ribbon and text colors.
- Copy the HTML and CSS and drop the ribbon into any card.
How the corner ribbon works
The ribbon is a wide, absolutely-positioned banner rotated 45 degrees and pushed into the corner of its container. The container needs position: relative so the ribbon anchors to it, and overflow: hidden so the ends of the diagonal banner are clipped neatly at the card edges instead of sticking out. The result is a clean triangle-corner label built entirely from CSS.
Placing the ribbon correctly
The two rules that make it work live on the card, not the ribbon: position: relative and overflow: hidden. Without relative positioning, the ribbon escapes to the page corner; without overflow hidden, its ends spill past the card. The generated CSS puts these on a wrapper class, so make sure your card uses that wrapper. Give the card a border-radius and the ribbon corners are trimmed to match automatically.
Using ribbons effectively
Ribbons are attention-grabbers, so use them sparingly — one per card, reserved for genuinely useful labels like a sale badge or a 'new' tag. Match the ribbon color to its meaning (a warm color for sales, your accent for 'new') and keep the text short so it fits the banner. Overusing ribbons dilutes their impact and clutters a grid of cards, so let them highlight the exceptions rather than the rule.
Pro tip
Keep ribbon labels to one or two uppercase words for maximum legibility on the narrow banner, and store the ribbon color as a CSS variable so a whole set of cards stays consistent. If you need a softer badge instead of a corner ribbon, a small pill using our CSS Button or Pattern generators can work well too.
FAQ
Is this CSS Ribbon Generator free?
How do I add a corner ribbon to a card?
Why is my ribbon sticking out of the card?
Can I put the ribbon in any corner?
Does the ribbon use an image?
How long can the ribbon text be?
Does it work in all browsers?
Related tools
Pro tip: pair this tool with CSS Box-Shadow Generator and CSS Flexbox Generator for a faster SEO workflow.