CKTIS / CSS
border-image-source — border image source
The border-image-source property selects an image to replace the ordinary CSS border. It accepts none or <image>, including a gradient. It defines the source; other border-image-* properties control slicing and placement.
Version: CSS modules; structured CSSWG indexes reconciled with pinned MDN BCD; Chromium 152 scope gate, per-example verification still required
Syntax
border-image-source: none | <image>;border-image-source accepts none or <image>, such as url("frame.png") or linear-gradient(...). Its initial value is none; it is not inherited, and its animation type is discrete. An available image replaces the ordinary border. With none, or when the image cannot be displayed, the ordinary border is used.
The source does not define slicing: border-image-slice does that. border-image-width, border-image-outset, and border-image-repeat control the fragments’ width, extension, and repetition. The image center is discarded by default; the fill keyword in border-image-slice preserves it.
Border images do not change layout: reserved space still depends on border-width and border-style. Set border before border-image-* properties because that shorthand resets them. The property does not apply to internal table elements when border-collapse: collapse.
The example uses a gradient without external files. Expect a white 160 × 80 px content area with a 12 px border, blue on the left and red on the right. Changing border-image-source to none should reveal a black border without changing dimensions.
Examples
<!doctype html>
<html lang="en">
<meta charset="utf-8">
<title>border-image-source</title>
<style>
.frame {
width: 160px;
height: 80px;
border: 12px solid black;
border-image-source: linear-gradient(to right, #0000ff, #ff0000);
border-image-slice: 1;
background: white;
}
</style>
<div class="frame"></div>
</html>Result
A white 160 × 80 px content area surrounded by a 12 px gradient border, blue on the left and red on the right.
The displayed code and declared result were verified in an isolated environment using the method recorded in the verification evidence for this exact version.