HTML | DOM Style borderImageRepeat Property
The borderImageRepeat property in HTML DOM is used to set or return the borderImageRepeat property. It specifies whether the border-image should repeat to fill the area, stretched to fill the area, set to the initial value, inherit property from its parent, etc. Depending on the need it will set accordingly to make the image border look more attractive.
Syntax:
- It returns the borderImageRepeat property.
object.style.borderImageRepeat
- It sets the borderImageRepeat property.
object.style.borderImageRepeat="stretch|repeat|round| initial|inherit"
Return value: It returns the border image repeat property.
Property Values:
- stretch: This property is used to stretch the image to fill the area. It is the default value.
Syntax:
object.style.borderImageRepeat="stretch";
Example:
<!DOCTYPE html><html><head><style>#GFG {border: 20px solid transparent;width: 200px;padding: 10px 20px;/* For Safari Browser */-webkit-border-image: url(50 50 round;/* For Opera Browser */-o-border-image: url(50 50 round;border-image: url(50 50 round;}</style></head><body><divid="GFG"><h1>GeeksforGeeks</h1></div><br><buttononclick="myGeeks()">Click Here!</button><p>Click on button to change property</p><script>function myGeeks() {/* For Safari Browser */document.getElementById("GFG").style.WebkitBorderImage =50 50 stretch";/* For Opera Browser */document.getElementById("GFG").style.OBorderImage =50 50 stretch";document.getElementById("GFG").style.borderImage =50 50 stretch";}</script></body></html>chevron_rightfilter_noneOutput:
Before click on the button:

After click on the button:

- repeat: This property is used to repeat the border image to fill the area.
Syntax:
object.style.borderImageRepeat = "repeat";
Example:
<!DOCTYPE html><html><head><style>#GFG {border: 15px solid transparent;width: 200px;padding: 10px 20px;/* For Safari Browser */-webkit-border-image: url(50 50 stretch;/* For Opera Browser */-o-border-image: url(50 50 stretch;border-image: url(50 50 stretch;}</style></head><body><divid="GFG"><h1>GeeksforGeeks</h1></div><br><buttononclick="myGeeks()">Click Here!</button><p>Click on button to change property</p><script>function myGeeks() {/* For Safari Browser */document.getElementById("GFG").style.WebkitBorderImage =50 50 repeat";/* For Opera Browser */document.getElementById("GFG").style.OBorderImage =50 50 repeat";document.getElementById("GFG").style.borderImage =50 50 repeat";}</script></body></html>chevron_rightfilter_noneOutput:
Before click on the button:

After click on the button:

- round: It is used to repeat the image to fill the area. If the image doesn’t fill the area in whole number of tiles the image is rescaled.
Syntax:
object.style.borderImageRepeat = "round";
Example:
<!DOCTYPE html><html><head><style>#GFG {border: 15px solid transparent;width: 200px;padding: 10px 20px;/* For Safari Browser */-webkit-border-image: url(50 50 stretch;/* For Opera Browser */-o-border-image: url(50 50 stretch;border-image: url(50 50 stretch;}</style></head><body><divid="GFG"><h1>GeeksforGeeks</h1></div><br><buttononclick="myGeeks()">Click Here!</button><p>Click on button to change property</p><script>function myGeeks() {/* For Safari Browser */document.getElementById("GFG").style.WebkitBorderImage =50 50 round";/* For Opera Browser */document.getElementById("GFG").style.OBorderImage =50 50 round";document.getElementById("GFG").style.borderImage =50 50 round";}</script></body></html>chevron_rightfilter_noneOutput:
Before click on the button:

After click on button:
- space: The only difference with the repeat value is that if it does not fill the area with a whole number of tiles, then extra space is distributed around the tiles.
Syntax:
object.style.borderImageRepeat = "space";
Example:
<!DOCTYPE html><html><head><style>#GFG {border: 15px solid transparent;width: 200px;padding: 10px 20px;/* For Safari Browser */-webkit-border-image: url(50 50 stretch;/* For Opera Browser */-o-border-image: url(50 50 stretch;border-image: url(50 50 stretch;}</style></head><body><divid="GFG"><h1>GeeksforGeeks</h1></div><br><buttononclick="myGeeks()">Click Here!</button><p>Click on button to change property</p><script>function myGeeks() {/* For Safari Browser */document.getElementById("GFG").style.WebkitBorderImage =50 50 space";/* For Opera Browser */document.getElementById("GFG").style.OBorderImage =50 50 space";document.getElementById("GFG").style.borderImage =50 50 space";}</script></body></html>chevron_rightfilter_noneOutput:
Before click on button:

After click on button:
- initial: It is used to set borderImageRepeat property to its default value.
- inherit: It is used to set borderImageRepeat property from its parent element.
Browser Support: The browser supported by DOM style borderImageRepeat property are listed below:
- Google Chrome
- Internet Explorer 11.0
- Mozila firefox
- Safari 6.0
Recommended Posts:
- HTML | DOM Style top Property
- HTML | DOM Style right Property
- HTML | DOM Style fontStyle Property
- HTML | DOM Style textDecorationColor Property
- HTML | DOM Style lineHeight Property
- HTML | DOM Style minWidth Property
- HTML | DOM Style order Property
- HTML | DOM Style wordSpacing Property
- HTML | DOM Style animationFillMode Property
- HTML DOM | Style pageBreakAfter Property
- HTML | DOM Style columnCount Property
- HTML | DOM Style padding Property
- HTML | DOM Style outlineStyle Property
- HTML | DOM Style borderRadius Property
- HTML | DOM Style clear Property
If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to contribute@geeksforgeeks.org. See your article appearing on the GeeksforGeeks main page and help other Geeks.
Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.

