CKTIS / CSS
border-image-repeat — tiling a border image
The border-image-repeat property controls stretching and tiling of border-image pieces. It accepts one or two keywords that independently control the horizontal and vertical directions.
Version: CSS modules; structured CSSWG indexes reconciled with pinned MDN BCD; Chromium 152 scope gate, per-example verification still required
Syntax
border-image-repeat: [ stretch | repeat | round | space ]{1,2};border-image-repeat controls scaling and tiling of border-image pieces. The first value controls the horizontal direction of the top, middle, and bottom pieces; the second controls the vertical direction of the left, middle, and right pieces. An omitted second value equals the first. This is not top–right–bottom–left ordering.
stretch stretches a piece to fill its region. repeat tiles it, potentially clipping copies at the ends. round additionally resizes tiles so that a whole number fits. space preserves tile size after initial scaling and distributes leftover space around the tiles.
The initial value is stretch; the property is not inherited and animates discretely. It does not supply an image itself: also set border-image-source and suitable border-image-slice values. The middle is painted only with fill in border-image-slice. A later border-image shorthand can reset the repeat setting.
The example uses round stretch: the top and bottom edges tile with size adjustment, while the side edges stretch. The content box measures 230px × 90px with a 12px border; the center is not painted by the border image.
Examples
<!doctype html>
<meta charset="utf-8">
<title>border-image-repeat</title>
<style>
.frame {
width: 230px;
height: 90px;
border: 12px solid #334155;
border-image-source: repeating-linear-gradient(
90deg, #2563eb 0 10px, #fbbf24 10px 20px
);
border-image-slice: 12;
border-image-repeat: round stretch;
}
</style>
<div class="frame"></div>Result
A 230px × 90px content box with a 12px image border. The top and bottom edge slices use round; the left and right edge slices use stretch. The center remains unpainted by the border image.
The displayed code and declared result were verified in an isolated environment using the method recorded in the verification evidence for this exact version.