CSS Ribbon Generator

A diagonal ribbon in the corner of a card.


The card hides overflow and the ribbon is a rotated strip anchored to the top right. Keep the label short or it will run off the strip.

Frequently asked questions

Can the ribbon sit on the left?

In the copied CSS, change right to left and use rotate(-45deg).

Does overflow hidden clip the card shadow?

It clips the ribbon ends, which is the point. Put the shadow on a wrapper if you also need a shadow.