CSS Gradient Border

Generate CSS gradient borders with no images — background-clip trick for border-radius support, or border-image for simplicity. Customize colors, angle and width, copy the CSS instantly.

Method
Background Clip — supports border-radius. Uses a pseudo-element with a gradient background clipped behind a solid inner fill.
Gradient Colors
Presets
Options
Angle 135°
Border width 2px
Border radius 12px
Inner bg #07070A
div
div
button
input
📦 50 CSS Gradient Presets
Download all 50 presets — copy-paste ready. One-time, €5.
✓ Matching set, tested together · ✓ Commercial & client projects OK · ✓ Instant download
€5 →
🎁 Not ready to buy? Get 10 free CSS presets →

About CSS Gradient Borders

There is no direct border-gradient CSS property. Two workarounds exist. The border-image method is simple — border-image: linear-gradient(...) 1 — but it fundamentally cannot be combined with border-radius. The background-clip (pseudo-element) method is more code but fully supports rounded corners: a ::before pseudo-element with the gradient background sits behind the element with inset: -Npx and a slightly larger border-radius, while the element itself has a solid background that covers the inner area. Set z-index: -1 on the pseudo-element so it appears behind. This technique is broadly supported in all modern browsers.

Related Tools

CSS Gradient Generator Linear, radial and conic gradients with multiple color stops Border Radius Generator All four corners independently — round, pill, blob shapes Gradient Text Generator CSS gradient text via background-clip with animated options CSS Card Generator Card component styles — background, shadow, border, glass, hover effec