border-image-slice

Determines how to 'cut' the border image into nine pieces (four corners, four edges, and a center). These pieces are then used to build the final border by resizing them to fit your element.

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

/* Usage Example */
.sliced-box {
  border: 30px solid;
  border-image-source: url(';border.png');
  /* Cut 30px from each edge of the image source */
  border-image-slice: 30;
}

/* Syntax */
border-image-slice: number;
border-image-slice: percentage;
border-image-slice: fill;

/* Global values */
border-image-slice: inherit;
border-image-slice: initial;
border-image-slice: revert;
border-image-slice: revert-layer;
border-image-slice: 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.

15+
15+
6+
12+
Kinsta

Your first month is free

Managed WordPress hosting for faster sites.

Learn more

New CSS drops.

Join 600+ readers who've survived clearfix hacks.

ESC