property

border-image — CSS reference

Shorthand for the five image-border longhands. The source is divided into nine regions; corners are placed at the corners and edge regions are scaled or tiled. The normal border widths still determine layout. A solid border provides a fallback if the image cannot be used. Omitted shorthand components reset. Not inherited.

Formal Syntax & Structure

css syntaxcss
<'border-image-source'> || <'border-image-slice'> [ / <'border-image-width'>? [ / <'border-image-outset'> ]? ]? || <'border-image-repeat'> (representative)

Working Example

Example Snippetcss
<!doctype html><html lang="en"><meta charset="utf-8"><title>CSS visual effects lab</title><style>body {margin:0} .sample {background:#dcebe9;color:#182e32}body{background:white} #a{position:relative; margin:20px;width:80px;height:60px;background:rgb(255,0,0);box-sizing:content-box} #a{border:10px solid green;border-image:linear-gradient(blue,blue) 1 / 10px stretch}</style><body><div id="a" aria-hidden="true"></div><p>Decorative effect example.</p></body></html>
CSS Reference