Gradient Border Generator

Give a box a gradient border without an extra element.


The element has a transparent border. Two backgrounds are painted: a solid fill clipped to the padding box, and a gradient clipped to the border box. The fill covers the middle, so only the border ring shows the gradient.

Frequently asked questions

Can the middle be transparent?

Replace the fill color with transparent if the page background should show through. The preview uses the color you picked.

Does border-radius still work?

Yes. Both backgrounds use the same radius, so the ring follows the corner.