Make a gradient border in CSS
Pick your brand colour. Get a subtle gradient border with rounded corners for a card, button or panel, and copy the CSS.
- Free, no sign-up
- Nothing uploaded
- CSS, HTML, Tailwind
No colour handy? Try one:
How it works
- Give your brand colour. Pick it, or type a hex code,
rgb()orhsl(). The border appears as soon as the colour reads. - Three stops, as good gradient borders use. A neutral highlight, your colour, and a neutral fade, at 135° for cards and 160° for buttons and tabs. The page picks the opacity of your colour so it shows on your surface without shouting.
- Say where it sits. Dark, light, or both (the CSS switches with
prefers-color-scheme); a card, button, active tab or hero panel; and whether the element has a solid fill or a background of its own that must show through. - Copy it. The CSS, the HTML, or Tailwind classes, or download a demo page. Buttons and tabs get a focus ring of their own.
- Read the border check. It flags an edge you can barely see, an edge louder than your content, neon colours, rainbow stops, too many strong stops, and widths that read as a frame.
Questions
- How do I make a gradient border with rounded corners?
- border-image ignores border-radius, so this page uses two backgrounds instead: the surface colour clipped to the padding box and the gradient clipped to the border box, under a transparent border. The corners stay round and there is no extra element.
- What if my card already has a background image or a blur?
- Choose Keep my background. The border is then drawn by a ::before ring that a mask cuts out of the middle, so your own background shows through untouched. The element needs position: relative, which the CSS sets.
- Why does the light version use different colours?
- A white highlight that reads well on a dark card disappears on a white one, and the same opacity rarely works on both. The light version uses a dark ink instead of white and its own brand opacity, and the CSS switches with prefers-color-scheme.
- Why is it so subtle?
- A gradient border should frame the content, not compete with it. The default keeps most stops below 40% opacity. If you want more, set Strength to Medium or Strong; the check tells you when it turns loud.
- What does the AI step do?
- It reads a short description of your site and suggests two or three styles in your colour. The page measures each one on your surfaces and refuses any that is invisible, loud, neon, a rainbow, or brings in a colour you did not give.
- Is anything uploaded?
- No. The border, the check and every copy and download are made inside your browser tab. Only the optional AI step sends your colour, your options and your description, and only when you press its button.