CSS Backgrounds & Borders 3 border-image

1 — 9-slice from a raster frame texture

The 12×12 source (a 2px ring around a lighter center) is sliced 2/2/2/2, then each region is stretched or tiled to a 12pt border.

stretch (default)
repeat
slice ... fill

1b — round and space

round resizes each edge/center tile so a whole number of them fit exactly, with no partial tile at the corner; space keeps every tile at its natural size and inserts equal gaps between them so the first and last still touch the edges — both shown here against a card width the plain 12pt tile size (repeat, above) does not divide evenly.

round
space

2 — border-image-outset

The painted frame extends past the border box without affecting layout - the dashed guide shows the untouched border box underneath.

outset: 8pt

3 — a gradient source (no raster image needed)

border-image-source accepts any <image>, including a gradient - useful for a colored frame with no asset at all.

linear-gradient, slice:1 stretch
conic-gradient, rounded corners