SolutionsCase StudiesAI ToolsResourcesAboutContact
Get Your Free AI Automation Audit Book a Free 30-Minute Strategy Call
Playground~/frontend Open editor

~/css/ribbons

8 CSS Ribbons

8 Pure CSSPublished 2026-10-04Free · no sign-up

Eight ribbons and labels: a diagonal corner ribbon, a ribbon folded around a card edge, a notched heading banner, a price tag, a hanging bookmark, a shiny gradient pill, a section ribbon with folded ends and a rosette award badge.

01. Diagonal Corner Ribbon

RibbonProduct

The classic ribbon across the top-right corner of a card, rotated 45 degrees and clipped by the card's overflow. The ribbon text is a real span inside the card, so it is read with the card content, and the card keeps its rounded corners.

View code
<article class="crn">
  <span class="rib">Bestseller</span>
  <h3>Stoneware mug</h3>
  <p>Glazed by hand in small batches.</p>
  <b>$24</b>
</article>
.crn { box-sizing: border-box; max-width: 100%; position: relative; width: 240px; overflow: hidden; padding: 70px 20px 20px; border-radius: 16px; background: #fff; box-shadow: 0 10px 28px -14px rgba(16,24,40,.35); font-family: Inter, system-ui, sans-serif; color: #475467; }
.rib { position: absolute; top: 22px; right: -36px; width: 150px; padding: 6px 0; background: #dc2626; color: #fff; font-size: 12px; font-weight: 800; letter-spacing: .04em; text-align: center; text-transform: uppercase; transform: rotate(45deg); box-shadow: 0 2px 6px rgba(0,0,0,.2); }
.crn h3 { margin: 0 0 4px; color: #101828; font-size: 17px; }
.crn p { margin: 0 0 10px; font-size: 14px; }
.crn b { color: #101828; font-size: 18px; }

02. Folded Edge Ribbon

Ribbon3D

A ribbon that wraps around the left edge of a card, with a small dark triangle under it to suggest a fold. The fold is a pseudo-element drawn with borders, so the whole effect is CSS, and the ribbon colour is set by one custom property.

View code
<article class="fld" style="--rb:#7c3aed">
  <span class="rb">New</span>
  <h3>Course: Grid in a day</h3>
  <p>12 lessons, all levels.</p>
</article>
.fld { box-sizing: border-box; max-width: 100%; position: relative; width: 260px; padding: 54px 20px 20px; border-radius: 14px; background: #151a26; color: #aab3c7; font-family: Inter, system-ui, sans-serif; }
.rb { position: absolute; top: 16px; left: -8px; padding: 5px 14px; border-radius: 0 4px 4px 0; background: var(--rb); color: #fff; font-size: 12px; font-weight: 800; letter-spacing: .05em; text-transform: uppercase; }
.rb::after { content: ""; position: absolute; left: 0; top: 100%; border-top: 8px solid #3b1d7a; border-left: 8px solid transparent; }
.fld h3 { margin: 0 0 4px; color: #fff; font-size: 16px; }
.fld p { margin: 0; font-size: 14px; }

03. Notched Banner Ribbon

HeadingRibbon

A heading banner with notched tails on both ends, made with clip-path on a single element. It works for section titles and award labels, and the text stays a real heading so it remains part of the page outline.

View code
<h2 class="ntc">Award winning 2026</h2>
.ntc { box-sizing: border-box; max-width: 100%; margin: 0; padding: 12px 42px; background: #f59e0b; color: #451a03; font: 800 18px Inter, system-ui, sans-serif; text-align: center; clip-path: polygon(0 0, 100% 0, calc(100% - 18px) 50%, 100% 100%, 0 100%, 18px 50%); }

04. Price Tag Ribbon

TagSale

A tag-shaped label with a pointed end and a punched hole, for prices and discounts. The shape is one clip-path polygon and the hole is a pseudo-element circle in the background colour, so it scales with the text.

View code
<span class="ptg">-30% today</span>
.ptg { box-sizing: border-box; max-width: 100%; position: relative; display: inline-block; padding: 10px 20px 10px 34px; background: #34d399; color: #062b1f; font: 800 16px Inter, system-ui, sans-serif; clip-path: polygon(16px 0, 100% 0, 100% 100%, 16px 100%, 0 50%); }
.ptg::before { content: ""; position: absolute; left: 16px; top: 50%; width: 8px; height: 8px; border-radius: 50%; background: #0e1118; transform: translateY(-50%); }

05. Vertical Bookmark Ribbon

BookmarkCard

A bookmark ribbon hanging from the top of a card with a V-shaped notch at the bottom, often used for Featured or Saved. The notch is a clip-path, and the text is short so it fits the narrow ribbon without wrapping.

View code
<article class="bkm">
  <span class="bk">Top pick</span>
  <h3>Linen apron</h3>
  <p>Heavy linen, two deep pockets, adjustable strap.</p>
</article>
.bkm { box-sizing: border-box; max-width: 100%; position: relative; width: 260px; padding: 20px 80px 20px 20px; border: 1px solid #e4e7ec; border-radius: 14px; background: #fff; font-family: Inter, system-ui, sans-serif; color: #475467; }
.bk { position: absolute; top: -4px; right: 18px; display: grid; place-items: center; width: 46px; height: 64px; padding-bottom: 10px; box-sizing: border-box; background: #0f766e; color: #fff; font-size: 10.5px; font-weight: 800; line-height: 1.1; text-align: center; text-transform: uppercase; clip-path: polygon(0 0, 100% 0, 100% 100%, 50% 82%, 0 100%); }
.bkm h3 { margin: 0 0 4px; color: #101828; font-size: 16px; }
.bkm p { margin: 0; font-size: 14px; line-height: 1.5; }

06. Gradient Shine Ribbon

AnimationGradient

A pill ribbon with a gradient fill and a light sheen that sweeps across now and then, for premium labels. The sheen is a pseudo-element moved with a transform animation and is removed entirely for reduced motion.

View code
<span class="shn">Pro plan</span>
.shn { position: relative; display: inline-block; overflow: hidden; padding: 8px 18px; border-radius: 999px; background: linear-gradient(90deg, #f59e0b, #ec4899, #8b5cf6); color: #fff; font: 800 14px Inter, system-ui, sans-serif; letter-spacing: .04em; text-transform: uppercase; }
.shn::after { content: ""; position: absolute; top: 0; bottom: 0; left: -40%; width: 30%; background: linear-gradient(90deg, transparent, rgba(255,255,255,.45), transparent); transform: skewX(-20deg); animation: shn 3s ease-in-out infinite; }
@keyframes shn { 0%, 60% { left: -40%; } 100% { left: 130%; } }
@media (prefers-reduced-motion: reduce) { .shn::after { animation: none; display: none; } }

07. Full-Width Section Ribbon

BannerLayout

A wide ribbon that spans a section with its ends folding behind, the classic shape for a headline over a pricing table or a certificate. The folds are two pseudo-elements in a darker shade placed behind the main band.

View code
<div class="sec"><p>Limited offer ends Sunday</p></div>
.sec { box-sizing: border-box; max-width: 100%; position: relative; width: 360px; padding: 0 22px; font: 800 15px Inter, system-ui, sans-serif; }
.sec p { position: relative; z-index: 1; margin: 0; padding: 12px; background: #2563eb; color: #fff; text-align: center; }
.sec::before, .sec::after { content: ""; position: absolute; top: 10px; width: 34px; height: 100%; background: #1e3a8a; }
.sec::before { left: 0; clip-path: polygon(0 0, 100% 0, 100% 100%, 0 100%, 12px 50%); }
.sec::after { right: 0; clip-path: polygon(0 0, 100% 0, calc(100% - 12px) 50%, 100% 100%, 0 100%); }

08. Rosette Award Badge

AwardBadge

A rosette badge with a ringed circle and two hanging tails, drawn as a circle with a double ring from layered box-shadows and clip-path polygons for the tails. It works as a seal for awards or guarantees, and the text inside is real content.

View code
<div class="ros"><div class="seal"><b>30</b><span>day returns</span></div><i class="t1"></i><i class="t2"></i></div>
.ros { position: relative; width: 120px; height: 150px; font-family: Inter, system-ui, sans-serif; }
.seal { position: relative; z-index: 1; display: grid; place-content: center; justify-items: center; width: 104px; height: 104px; margin: 8px; background: #fbbf24; color: #451a03; border-radius: 50%; box-shadow: 0 0 0 4px #0e1118, 0 0 0 8px #fbbf24, 0 0 0 10px #d97706; }
.seal b { font-size: 34px; line-height: 1; }
.seal span { font-size: 11px; font-weight: 700; text-transform: uppercase; }
.ros i { position: absolute; top: 90px; width: 28px; height: 60px; background: #d97706; clip-path: polygon(0 0, 100% 0, 100% 100%, 50% 80%, 0 100%); }
.ros .t1 { left: 30px; transform: rotate(12deg); }
.ros .t2 { right: 30px; transform: rotate(-12deg); }

About these CSS Ribbons

Shapes from clip-path

Notches, arrows, tags and bookmarks are single elements cut with clip-path: polygon(), which keeps the markup tiny and scales with the text.

Corner ribbons

A corner ribbon is a rotated band positioned past the card's edge; overflow: hidden on the card trims it neatly, so the card keeps its rounded corners.

Keep it real text

Ribbon labels such as Bestseller or New should be text inside the card so they are read with it. Avoid putting important information only in a decorative graphic.

Use sparingly

If every card has a ribbon, none stand out. Reserve them for one or two items, and keep the words short so they fit narrow shapes.

Frequently asked questions

Do ribbons need images?

No. All eight are pure CSS.

Will clip-path work everywhere?

Yes, polygon clip-paths are supported in all current browsers.

How do I change the ribbon colour?

Edit the background, or the custom property in the folded ribbon demo.