Gradient border generator
Draw a gradient border with a transparent inside using mask-composite. Pick a linear or conic gradient, set the width and radius, and copy the CSS.
Runs in your browser. Nothing you enter is uploaded.
CSS
About this tool
The gradient border generator draws a linear or conic gradient border with a transparent inside and gives you the CSS. The gradient sits on a ::before layer, and mask with the exclude compositing mode cuts out the content box, so the border keeps the element’s border-radius and the background behind it shows through.
- Why not use border-image?
- border-image ignores border-radius, so rounded corners are lost. The mask approach keeps them.
- Does the gradient layer block clicks on the element?
- No. The ::before layer has pointer-events: none, so clicks and text selection reach the content.