CSS RIBBON GENERATOR
Build a corner sash or banner ribbon and copy the CSS and HTML.
In short
Generate the CSS and HTML for a diagonal corner sash (top left or top right) or a banner ribbon with a swallowtail, arrow, or flat tail. You choose the text, colors, size, and an optional drop shadow, and get a ready-to-paste snippet built from plain CSS and clip-path. It runs in your browser and nothing is uploaded.
SALE
.ribbon-box {
position: relative;
}
.ribbon-corner {
position: absolute;
top: 0;
right: 0;
width: 140px;
height: 140px;
overflow: hidden;
pointer-events: none;
}
.ribbon-corner span {
position: absolute;
top: 28px;
right: -46px;
width: 210px;
padding: 6px 0;
text-align: center;
background: #ff6a35;
color: #ffffff;
font: 700 14px/1.2 system-ui, sans-serif;
letter-spacing: 0.1em;
transform: rotate(45deg);
box-shadow: 0 2px 4px rgb(0 0 0 / 0.35);
}Example output (default settings)
.ribbon-box {
position: relative;
}
.ribbon-corner {
position: absolute;
top: 0;
right: 0;
width: 140px;
height: 140px;
overflow: hidden;
pointer-events: none;
}
.ribbon-corner span {
position: absolute;
top: 28px;
right: -46px;
width: 210px;
padding: 6px 0;
text-align: center;
background: #ff6a35;
color: #ffffff;
font: 700 14px/1.2 system-ui, sans-serif;
letter-spacing: 0.1em;
transform: rotate(45deg);
box-shadow: 0 2px 4px rgb(0 0 0 / 0.35);
}<div class="ribbon-box">
<!-- your card or image here -->
<div class="ribbon-corner"><span>SALE</span></div>
</div>How to make a CSS ribbon
- 1
Pick a style: corner sash on the top right or top left, or a banner ribbon.
- 2
Type the ribbon text and choose the ribbon and text colors.
- 3
Adjust the corner size, or for a banner pick the tail shape and its depth.
- 4
Copy the CSS and HTML and paste them into your page.
Questions
- How does the corner sash work?
- A square box in the corner has overflow hidden. Inside it a wide strip is rotated 45 degrees and pushed toward the corner, so only the diagonal band shows and the ends are clipped by the box. Put the ribbon inside a parent with position: relative.
- Why is the banner wrapped in an extra element when shadow is on?
- The banner tail is cut with clip-path, which would also clip a shadow drawn on the same element. A drop-shadow filter on a wrapper is applied after the clipping, so the shadow follows the cut tail shape.
- Can I use it on an image or card?
- Yes. Put the ribbon markup inside the card or image container and give that container position: relative. The corner sash has pointer-events: none so it never blocks clicks on what is under it.
- How long can the ribbon text be?
- The tool limits the text to 24 characters. A corner sash fits about 6–10 characters at the default size; raise the corner size for longer words. The banner grows with its text.
- Does it work in all browsers?
- The output uses transforms, overflow, clip-path, and filter: drop-shadow, which all current Chrome, Edge, Firefox, and Safari versions support. No images or JavaScript are needed.
Related tools
- CSS Ticket & Coupon Shape GeneratorGenerate CSS for a ticket or coupon shape with notched sides, top and bottom, or cut corners and a dashed perforation line, using a transparent mask.
- CSS Mask / Fade Edge GeneratorFade out the edges of an image or block with a mask-image gradient — top, bottom, sides, or all edges — and copy the CSS.
- CSS Animated Glowing Border GeneratorBuild a rotating conic-gradient border that chases around a card, with adjustable speed, thickness, and glow blur.
- CSS Speech Bubble GeneratorBuild a chat-style speech bubble with a border-trick tail on any side, and copy the CSS.
- CSS Gradient Border GeneratorBuild a rounded gradient border with 2-5 color stops using the padding-box/border-box trick, and copy the CSS.
- CSS Squircle GeneratorBuild an iOS-style continuous-curve squircle from a superellipse formula rendered as a clip-path polygon, and copy the CSS.
- CSS Clip-Path GeneratorDrag points on a live preview to build a clip-path: polygon() shape from a preset or from scratch, and copy the CSS.
- CSS Link Underline Effects GeneratorBrowse a gallery of 10 hover underline effects for links — slide in, center out, double line, dot grow, and more.
Updated