border-image

A massive shorthand for using an image (or gradient) to style an element's borders. It combines source, slice, width, outset, and repeat into one powerful line of CSS.

It is documented as part of the CSS Backgrounds and Borders specification.

/* Usage Example */
.premium-box {
  /* source | slice | repeat */
  border-image: linear-gradient(red, blue) 20% round;
  border-width: 10px;
  border-style: solid;
}

/* Syntax */
border-image: border-image-source;
border-image: border-image-slice;
border-image: border-image-width;
border-image: border-image-outset;
border-image: border-image-repeat;

/* Global values */
border-image: inherit;
border-image: initial;
border-image: revert;
border-image: revert-layer;
border-image: unset;
Widely available Since 2017 96% global usage

This feature is well established and works across many devices and browser versions. It has been available across browsers since 2017.

16+
15+
6+
12+

New CSS drops.

Join 750+ readers who've survived clearfix hacks.

ESC