Corner ribbons are perfect for highlighting "New," "Sale," or "Featured" items on cards and containers. Our generator eliminates the complex math of rotating text and positioning it in corners. It provides a simple markup and CSS solution that works within any relative-positioned parent element.
CSS Ribbon Generator
Create corner ribbons for cards or banners. Fully responsive and overflow-protected.
Configuration
Colors
Valid Content Area
CSS Code
.ribbon-container {
position: relative;
width: 300px;
height: 300px;
background: white;
border-radius: 8px;
overflow: hidden; /* Ensures ribbon doesn't overflow container */
box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}
.ribbon {
position: absolute;
top: 10px;
right: -40px;
bottom: auto;
left: auto;
width: 150px;
height: 40px;
background: #6366f1;
color: #ffffff;
display: flex;
align-items: center;
justify-content: center;
font-weight: bold;
text-transform: uppercase;
font-size: 12px;
transform: rotate(45deg);
transform-origin: center;
box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}About Create CSS Corner Ribbons
Pick Corner
Choose which side of the container to place the ribbon.
Set Text
Type your label (e.g., 'SAVE 40%').
Adjust Sizing
Fine-tune the thickness and rotation angle.
Copy CSS
Copy the generated code into your styles.
Key Features
Corner Anchoring
Snap ribbons to Top-Left, Top-Right, Bottom-Left, or Bottom-Right.
Auto-Calculations
Handles rotations and offsets for perfect corner fit.
Styling Control
Adjust ribbon width, thickness, and color depth.
Pure CSS
No images or SVGs; completely responsive design.
Frequently Asked Questions
The parent container must have 'position: relative' and the ribbon itself uses 'position: absolute' with top/right/left/bottom offsets.
Short text works best for corner ribbons. If the text is too long, you may need to increase the ribbon width or font size.
Yes, ribbons work perfectly on any rectangular or square container including cards, buttons, and sections.
Related Tools
View allMerge PDF
Combine multiple PDFs into one unified document.
Word Counter
Count words and chars.
Unit Converter
Convert length, weight, etc.
Image Converter
Convert between JPG, PNG, WEBP, and BMP.
Password Generator
Generate strong, secure passwords.
QR Code Generator
Create QR codes.
Last updated on