The border-image-repeat property controls how border image edge slices are drawn along each side — stretched, tiled, rounded to fit, or spaced evenly.
01
Edge Tiling
How sides repeat.
02
stretch
Default keyword.
03
repeat
Tile the image.
04
round
Fit tiles evenly.
05
space
Add gap spacing.
06
border-image
Longhand property.
Fundamentals
Definition and Usage
The border-image-repeat CSS property defines how the middle sections of a border image are repeated along the top, right, bottom, and left edges of an element. Corner slices stay fixed; this property affects only the edge regions between corners.
It is especially useful for decorative borders built from images or repeating patterns. Choosing the right keyword helps edges look smooth, evenly tiled, or intentionally stretched depending on your design.
💡
Beginner Tip
Start with round when using tiled border artwork — it scales tiles to fit each side cleanly. Use stretch when you want one continuous edge image.
Foundation
📝 Syntax
border-image-repeat accepts one or two keyword values:
One keyword applies the same behavior to all four edges.
Two keywords set horizontal edges first, then vertical edges.
Valid keywords are stretch, repeat, round, and space.
Requires a border image source and slice to be visible.
Can also be set through the border-image shorthand.
Cheat Sheet
⚡ Quick Reference
Question
Answer
Initial value
stretch
Applies to
Border image edge regions
Inherited
No
Animatable
No
Common use
Decorative tiled or stretched image borders
Defaults
Default Value
The default value of border-image-repeat is stretch. That means edge slices are scaled to fill the full length of each border side unless you choose another keyword.
Reference
💎 Property Values
Keyword
Example
Meaning
stretch
border-image-repeat: stretch;
Stretches edge slices to fill the border side
repeat
border-image-repeat: repeat;
Repeats edge tiles; may clip partial tiles
round
border-image-repeat: round;
Repeats tiles and scales them to fit evenly
space
border-image-repeat: space;
Repeats tiles with extra space distributed between them
Keyword Previews
stretchScales to fill
repeatTiles as-is
roundScales tiles to fit
spaceSpaces between tiles
Compare
border-image-repeat vs related properties
Property
Targets
Best for
border-image-repeat
How edge slices tile or stretch
Controlling border edge appearance
border-image-slice
How the source image is divided
Cutting corners and edges from artwork
border-image-source
The image or gradient used
Choosing the border artwork
border-image
Full border image shorthand
Setting source, slice, width, outset, and repeat together
Preview
👀 Live Preview
A box with a repeating pattern border using round:
Content inside the border.
Uses a repeating gradient source with border-image-repeat: round;.
Hands-On
Examples Gallery
Try border-image-repeat with round, stretch, repeat, space, and two-value syntax.
📚 Basic Repeat Keywords
Apply border image longhands and choose how edge slices are repeated.
Example 1 — Round Border Image Repeat
Apply a border image to a div and use round so tiles scale to fit each edge, as in the reference tutorial.
The first keyword applies to top and bottom edges; the second applies to left and right edges. This gives finer control over asymmetric frames.
🧠 How border-image-repeat Works
1
The image is sliced
border-image-slice divides the source into corners and edge strips.
Slice
2
You choose a repeat keyword
Set stretch, repeat, round, or space.
CSS rule
3
Edge strips fill each side
The browser tiles or scales the middle edge regions along each border.
Rendering
=
🔀
Decorative edge pattern
Your border edges look tiled, stretched, or evenly spaced based on the keyword you chose.
Compatibility
Modern Browser Support
The border-image-repeat property is supported in all modern browsers, including Chrome, Firefox, Safari, Edge, and Opera.
✓ Baseline · Modern browsers
Border image repeat in today’s browsers
Chrome, Edge, Firefox, Safari, and Opera support all four repeat keywords in current versions.
96%Modern browser support
Google Chrome15+ · Desktop & Mobile
Full support
Mozilla Firefox15+ · Desktop & Mobile
Full support
Apple Safari6+ · macOS & iOS
Full support
Microsoft Edge12+ · All versions
Full support
Opera15+ · Modern versions
Full support
border-image-repeat property96% supported
Bottom line: Use border-image-repeat freely in modern projects. Test tiled artwork with both wide and narrow elements.
Wrap Up
Conclusion
The border-image-repeat property gives you flexible control over how border image edges are drawn. Whether you need stretched gradients, tiled patterns, evenly rounded tiles, or spaced repeats, the right keyword makes decorative borders look polished.
Experiment with stretch, repeat, round, and space to see how each one changes the look of your border edges.
Use round for tiled border artwork on variable-width elements
Use stretch for smooth gradients or single-piece edge images
Test repeat behavior at different box sizes
Combine longhands when learning slice and repeat separately
Preview all four keywords before picking one for production
❌ Don’t
Expect repeat keywords to affect corner slices
Use repeat on small boxes if partial tile clipping looks bad
Forget to set border-image-source and border-image-slice
Assume round and space look identical on every browser
Rely on image borders alone for critical focus or accessibility cues
Summary
Key Takeaways
Knowledge Unlocked
Five things to remember about border-image-repeat
Use these points when tiling border image edges.
5
Core concepts
🔀01
Edge Repeat
Controls side tiling.
Purpose
⚡02
Default stretch
Scales to fit.
Default
🔀03
Four Keywords
stretch repeat round space.
Values
↔️04
Two Values
Horizontal | vertical.
Syntax
🛠05
Needs slice
Part of border-image.
Usage
❓ Frequently Asked Questions
The border-image-repeat property controls how the middle sections of a border image are drawn on each edge — whether they stretch, tile, round, or space to fit the border length.
The initial value is stretch, which scales the edge slices to fill the full length of each border side.
repeat tiles the edge image as-is and may clip partial tiles. round also tiles the image but scales the tiles so they fit evenly without clipping.
Yes. With two values, the first applies to the top and bottom edges and the second applies to the left and right edges.
No. border-image-repeat only affects how edge regions are painted when a border image source and slice are already applied.