Generator Tools
CSS Border Image Generator
Build a CSS border-image from a gradient with a live preview. Set slice, width, outset, and repeat, then copy the full rule, shorthand, or longhand.
Start from a preset
Gradient source
The border image is a CSS gradient, so the source is plain text and nothing is uploaded.
Comma separated colors. You can add positions, for example #fff 0 8px, transparent 8px 16px, to build stripes.
Slice
How far in from each edge the source is cut into corner and edge regions.
Width and outset
border-image needs a border to paint on. This sets the transparent border the image fills.
border-image-width
Pushes the border image outward beyond the border box.
Repeat
Horizontal edges (top, bottom)
Vertical edges (left, right)
Unlink axes to set the vertical edges separately.
Live preview
Tip: border-image only paints when the element also has a border-style. The output below sets a transparent solid border for that reason.
border-radius does not clip a border image. The preview keeps square corners even if you round the box.
CSS output
Full rule (recommended)
.fancy-border {
border: 18px solid transparent;
border-image: linear-gradient(45deg, #f59e0b, #ef4444, #ec4899) 30% / 18px / 0px stretch;
}border-image shorthand
border-image: linear-gradient(45deg, #f59e0b, #ef4444, #ec4899) 30% / 18px / 0px stretch;
Longhand properties
border-image-source: linear-gradient(45deg, #f59e0b, #ef4444, #ec4899); border-image-slice: 30%; border-image-width: 18px; border-image-outset: 0px; border-image-repeat: stretch;
Every value is generated in your browser and the same gradient drives the preview and the copied CSS. Nothing is uploaded.
How to use
- Pick a preset to start, or choose a gradient type (linear, radial, or conic) and edit the color stops to design the source.
- Set the slice values to control where the source is cut into corner and edge regions, and toggle fill if you want the center to show as a background.
- Adjust the element border-width so the border image has room to paint, then set border-image-width and outset as needed.
- Choose a repeat mode (stretch, repeat, round, or space) for the edges, and unlink the axes to set the vertical edges separately.
- Watch the live preview update, switch the background to check contrast, and remember border-image needs a border-style and ignores border-radius.
- Copy the full rule, the shorthand, or the longhand properties. Everything runs locally in your browser.
About this tool
The CSS Border Image Generator builds a working border-image declaration from a gradient and shows it rendering live as you change it, so you can stop guessing at one of the more confusing CSS properties. Instead of asking you to upload a picture, this tool uses a CSS gradient as the source, which means the border is defined entirely by text, travels with the CSS you copy, and never leaves your browser. You pick a linear, radial, or conic gradient and a list of color stops, and that exact gradient string is what both the preview and every copied output use, so what you see is what you ship. The four properties that make border-image hard to reason about each get a dedicated control. border-image-slice sets how far in from each edge the source is cut into the nine regions border-image uses: four corners, four edges, and one center; you can set the four sides together or independently in percent or pixels, and the fill keyword keeps the center region as a background instead of discarding it. border-image-width sets how thick the painted image is on each side and is a separate property from the element's border-width, which is a common source of confusion, so the tool exposes both. border-image-outset pushes the image outward beyond the border box. border-image-repeat decides how the edge slices fill each edge, with stretch, repeat, round, and space, and because the top and bottom edges can use a different mode from the left and right edges, you can link the axes or set them apart. The single most common reason border-image appears to do nothing is that the element has no border-style, because the property is silently ignored without one, so the recommended output always pairs the border-image with a transparent solid border that gives it room to paint. The tool also reminds you that border-radius does not clip a border image, which is why rounded corners on the box do not round the frame. Presets cover a warm stretched frame, a tiled conic ribbon, a filled neon panel, a thin accent border, and spaced diagonal stripes, and you can switch the preview between dark, light, and checker backgrounds to check contrast. Output comes three ways: a full rule for a selector you name, the border-image shorthand on its own, and the five longhand properties. Everything is computed in your browser and nothing you enter is uploaded, logged, or sent anywhere.
Free to use. Works in your browser. No signup, no login.
Related tools
You may also like
CSS Gradient Generator
Linear, radial, and conic gradients with multi-stop editor and live preview.
Open tool
GeneratorCSS Conic Gradient Generator
Build conic-gradient backgrounds with a draggable center, smooth or hard stops, and copy-ready CSS, Tailwind, or SVG.
Open tool
GeneratorCSS Border Radius Generator
Visual editor for border-radius with elliptical corners and copy-ready CSS.
Open tool
GeneratorCSS Outline Generator
Outline shorthand, focus-visible variant, and Tailwind output with a live preview.
Open tool
GeneratorCSS Box Shadow Generator
Layered box-shadow with live preview, opacity, inset, and Tailwind output.
Open tool