The border-image-slice property cuts the image from border-image-source into nine regions: four corners, four edges, and a middle. The numbers or percentages set how far each cut sits from the image sides.
Corners are used once. Edges are stretched or tiled by border-image-repeat. The middle is discarded unless you add the fill keyword. Negative values are invalid; values above the image size are clamped to 100%.
Baseline · Widely available.
Not deprecated and not experimental. Available across browsers since July 2015. Needs a border-image-source to have any effect.
Syntax
CSS Syntax
syntax.css
border-image-slice:<number> | <percentage> | fill | initial | inherit;
Use one to four offsets (like margin). Optional fill can sit anywhere in the declaration. Example: border-image-slice: 30 fill;.
Values
Property Values
Value
Description
Try it
<number>
Offset in the source image’s coordinates (pixels for raster images). Default is 100%
Use a percentage.25% measures from each side of the source image.
Width and height. Horizontal offsets use the image width; vertical offsets use the image height.
Scale with the asset. If the image is replaced with a larger version of the same design, the relative cut stays in proportion.
Prefer % for SVG. For vector sources, percentages are usually clearer than unitless numbers.
Edge Cases & Pitfalls
If corners look stretched or the middle is missing, check these first.
source
No source, no slices
Slice only divides an image. Set border-image-source (or the shorthand) before you expect a frame.
match
Slice should match the artwork
If the decorative frame in the PNG is 30px thick, start with 30. A wrong value pulls the wrong part of the image into the corners.
fill
Middle is off by default
Without fill, zone 9 is discarded. Add fill when you want the center of the source inside the box.
clamp
Oversized values clamp to 100%
Offsets larger than the image dimension are treated as 100%. Negatives are invalid and the declaration is ignored.
reset
border resets the image
The border shorthand sets border-image back to none. Declare source and slice after border.
Compatibility
Browser Support
border-image-slice is a browser CSS property for decorative borders. Node.js, Deno, and Bun do not apply it.
✓ Baseline · Widely available
border-image-slice
Chrome 15+, Firefox 15+, Safari 6+, Edge 12+, Internet Explorer 11+. The fill keyword is supported from Chrome 16+.
97%Global support
Google Chrome15+ · fill 16+
Full support
Mozilla Firefox15+
Full support
Apple Safari6+
Full support
Microsoft Edge12+
Full support
Opera15+
Full support
Samsung Internet1.0+
Full support
Internet Explorer11
Full support
border-image-sliceWidely supported
Bottom line: Safe for production nine-slice frames. Match the slice to the artwork, and use fill when you need the middle. It is not a runtime API.
Remember
Key Takeaways
Role: cut the source into four corners, four edges, and an optional middle.
Default:100%. Not inherited. Middle discarded unless fill.
Values: numbers or percentages; one to four sides, like margin.
Match the art: set the slice to the frame thickness in the source image.
One line:border-image-slice decides which parts of the source become corners and edges — after you have a source, and optionally fill for the middle.
Frequently Asked Questions
It divides the border-image-source into nine regions: four corners, four edges, and a middle. The numbers or percentages set how far each cut sits from the image sides.
The initial value is 100%. That places the cuts at the far edges of the source image.
By default the middle region is discarded. fill keeps it and paints it inside the border, above the element’s background.
For raster images, a number is an offset in the image’s own pixel coordinates. For vector images, prefer percentages because a number is tied to the element size, not the SVG’s intrinsic size.
The slice must match the artwork. If the decorative frame in the image is 30px thick, start with border-image-slice: 30 and a similar border-width. Wrong values stretch or squash corners.
It is Baseline Widely available: Chrome 15+, Firefox 15+, Safari 6+, Edge 12+, and Internet Explorer 11. The fill keyword is supported from Chrome 16+. It is a browser CSS property, not a Node.js feature.