🖼️
developer

Gradient Border CSS Generator

Create gradient borders with live preview and generated CSS code. Customize colors, width, radius, and angle.

gradient border css generatorcss gradient borderborder gradientcss border generatorgradient border radius

Gradient border CSS generator

Create beautiful gradient borders with CSS

Customize colors, width, radius, and style — get the CSS code instantly.

Preview

This box has a gradient border ✨

CSS code

 

How to use

How to Use the Gradient Border CSS Generator

  1. 1 Pick two or three gradient colors using the color pickers.
  2. 2 Adjust the gradient angle with the direction slider.
  3. 3 Set the border width, border radius, and padding.
  4. 4 Choose a background color for the element interior.
  5. 5 See the live preview update in real time.
  6. 6 Click Copy CSS to copy the generated code.

CSS doesn't natively support gradient borders with the border property. This generator uses the background-image trick: it layers two backgrounds — a solid background-color clipped to the padding-box, and a gradient clipped to the border-box. With a transparent border, the gradient shows through where the border would be, creating the gradient border effect.

The generated CSS uses the background-clip property with two values: padding-box for the solid background and border-box for the gradient. This technique works in all modern browsers. The border must be set to transparent so the gradient background shows through. Adjust the angle to change the gradient direction — 0° goes bottom to top, 90° goes left to right, and 135° creates a diagonal.

More Developer tools

Related tools

You might also like