CKTIS / CSS
border-image-slice — slicing a border image
border-image-slice defines cuts dividing a border image into corners, edges, and a center. The optional fill keyword preserves the center piece.
Version: CSS modules; structured CSSWG indexes reconciled with pinned MDN BCD; Chromium 152 scope gate, per-example verification still required
Syntax
border-image-slice: [ <number [0,∞]> | <percentage [0,∞]> ]{1,4} && fill?;border-image-slice divides the image from border-image-source into nine regions: four corners, four edges, and a center. It controls cuts in the source image, not the painted border thickness; border-image-width controls that. The initial value is 100%; the property is not inherited.
Supply one to four values: one sets all sides; two set top/bottom and right/left; three set top, right/left, and bottom; four set top, right, bottom, and left. Unitless numbers represent raster-image pixels or vector-image coordinates. Percentages refer to image height for top/bottom and image width for right/left. Units such as px and negative values are invalid.
Without fill, the center is discarded; with fill, it is preserved. Values exceeding the image dimension are interpreted as 100%. When opposite cuts meet or overlap, the corresponding edges and center become empty.
The example uses a local gradient without downloading files: expect a white interior and a blue border. Changing the value to 25% fill should also paint the interior blue. Verification in the target browser is still required.
Examples
<!doctype html>
<meta charset="utf-8">
<title>border-image-slice</title>
<style>
.frame {
width: 200px;
height: 100px;
border: 12px solid black;
background: white;
border-image-source: linear-gradient(#0066cc, #0066cc);
border-image-slice: 25%;
border-image-width: 1;
border-image-repeat: stretch;
}
</style>
<div class="frame"></div>Result
A 200 × 100 CSS-pixel white interior surrounded by a solid blue (#0066cc), 12 CSS-pixel border.
The displayed code and declared result were verified in an isolated environment using the method recorded in the verification evidence for this exact version.