How to use the border generator
- Choose a type: solid (with eight line styles), gradient, or animated.
- Set the width. Turn off Same width on all sides for accent bars like a thick left border or an underline.
- Pick colors. Solid borders can use a different color per side; gradient borders take three colors and an angle.
- Round the corners and set the inside and background colors to match your page.
- Add an outline for a double-frame look or a focus style.
- Check contrast and copy CSS, SCSS or Tailwind.
Line styles at a glance
- Solid, dashed and dotted are the everyday styles. Dashed borders are the convention for file drop zones.
- Double draws two lines and needs at least 3px of width to show both.
- Groove, ridge, inset and outset shade the border to look carved or raised. They look dated in most modern designs, but suit retro interfaces.
Gradient border tips
Keep the border 2–4px wide so the gradient reads as a line rather than a frame. The inside color must be solid for the two-layer technique. For a transparent inside, use a mask-based approach instead. Animated borders are eye-catching: use one per page, for the element you really want people to notice.
Worked examples
Example 1: an accessible text input
Load Input: a 1px slate border (#64748B) on white with a 6px radius. The contrast check confirms more than 3:1 against both the white inside and the page, which WCAG 1.4.11 asks for when the border is what shows the field’s edge. Pair it with the Focus outline preset for the focused state, so keyboard users see a clear 3px blue ring offset by 2px.
Example 2: a file upload zone
Load Dashed upload. A 2px dashed indigo border on a pale indigo background is the familiar convention for “drop files here”. Increase the radius to 24px for a friendlier feel, and keep the dashed style: people recognise it instantly.
Example 3: a featured pricing card
Load Gradient sunset and set the inside color to your card background. The 4px gradient border follows the 20px corners exactly. For the most popular plan, switch to Animated and set a slow 6-second turn, so the border draws attention without being distracting.
Common mistakes
- Using border-image for rounded gradient borders: it ignores the radius, so use the two-background technique this tool exports.
- Removing focus outlines: replace them with a clearer style instead.
- Thin 3D styles: groove and ridge need at least 2px to show their shading.
Import CSS from your site
Already have a style you like? Open Import CSS (copy from a site), paste a rule or just its declarations from your stylesheet or your browser’s developer tools, and press Import into the controls. This tool reads the border shorthand, border-width, border-style, border-color and border-radius. Everything else, and rules for states such as :hover or media queries, is listed as skipped, and the import can be undone in one step.