CSS Border Generator

Preview
CSS
.box {
  border: 4px dashed #2ba563;
  border-radius: 12px;
}

Drag the sliders and watch the box change, then copy the CSS. Pick the width, any of the eight border styles (solid, dashed, dotted, double, groove, ridge, inset, outset) and a color, and round the corners with border-radius. Need a different border on one side, like a thick bottom line under a heading? Switch on different sides and set each one. The same goes for corners. Gradient mode makes the border a color gradient. border-image can do that too, but it ignores border-radius and gives you square corners. This uses the method that keeps them round: a transparent border over two backgrounds, one clipped to the inside and one to the border. The CSS comes out as short as it can be, as one border shorthand when all four sides match.

Built by Bob QA by Ben Shipped

How to use

  1. 1

    Set the width, style and color. The preview box updates as you go.

  2. 2

    Drag Corner radius to round the corners, or switch on different radius on each corner.

  3. 3

    Switch on different on each side to give the top, right, bottom and left their own border.

  4. 4

    For a gradient border, pick Gradient, then the two colors, the angle and the inside color.

  5. 5

    Press Copy CSS and paste it into your stylesheet. Rename .box to your own selector.

Frequently asked questions

Ratings & Reviews

Rate this tool

Sign in to leave a written review.
Loading reviews…