CSS Ribbon Generator
Design CSS ribbons, banners, and badges for your website content.
About the CSS Ribbon Generator
Ribbons, banners, and badges are a classic UI design element used to highlight content. Whether it's a "Best Seller" tag on an e-commerce product, a "New" badge on a blog post, or a "Featured" label on a pricing table, ribbons draw attention effectively. Creating these shapes manually using CSS borders and transforms can be tedious and error-prone.
Our CSS Ribbon Generator makes it effortless. You can visually design three popular styles:
- Corner Ribbon: A diagonal banner crossing the top corner of a card. Great for limited-time offers.
- Side Folded Ribbon: A horizontal banner that wraps around the edge of a container, creating a 3D fold effect.
- Bookmark Ribbon: A vertical tag hanging from the top edge, perfect for bookmarking or date labels.
The tool automatically calculates the complex CSS needed for the "folds" (using transparent borders on pseudo-elements) and generates the correct rotation angles. It also supports modern linear gradients, allowing you to create vibrant, eye-catching designs that match current web trends.
How to Use the Tool
- Select a Style: Choose between Corner, Side Fold, or Bookmark styles from the grid.
- Text: Enter the text you want to display (e.g., "New", "-50%", "Popular").
- Position: Toggle between Left and Right alignment.
- Colors: Pick a background color and text color. If you check "Enable Gradient", a second color picker will appear to let you create a smooth fade.
- Adjustments: Use the Size slider to scale the ribbon and the Offset slider to move it closer or further from the edge.
- Copy Code: Grab the generated HTML and CSS and paste it into your project. Ensure the parent container of your ribbon has
position: relative;andoverflow: hidden;(for corner ribbons).
Frequently Asked Questions
Why is my corner ribbon cut off?
Corner ribbons rely on `overflow: hidden` on their parent container. If the parent container does not have this property, the ribbon will stick out past the edges. Ensure the parent element (like a card or image wrapper) has `position: relative` and `overflow: hidden`.
How is the "folded" shadow created?
The 3D fold effect is created using a CSS pseudo-element (::after or ::before). We create a small triangle using CSS borders, color-matched to a darker shade of your main ribbon color, and position it behind the main ribbon element to simulate depth.
Can I use gradients?
Yes! Check the "Enable Gradient" box. You can select two colors to create a modern linear gradient background for your ribbon.