Open In App

CSS border-image-repeat Property

The border-image-repeat property in CSS is used to scale and tiling the border images. It can be used to match the middle part of the border image to the size of the border. It can have either one or two values. One is for the horizontal and one for the vertical axis. Only one value is given then it applies to all sides, but two values are given it is given one value for the horizontal and another for the vertical sides. 

Syntax:



border-image-repeat: stretch|repeat|round|initial|inherit

Property Values: 

Example: In this example, we are using border-image-repeat: stretch; property.






<!DOCTYPE html>
<html>
<head>
    <title>
        CSS border-image-repeat Property
    </title>
 
    <!-- CSS property -->
    <style>
        h2 {
            border: 20px solid transparent;
            padding: 20px;
            border-image-source:
            border-image-repeat: stretch;
            border-image-slice: 40;
            text-align: center;
        }
    </style>
</head>
 
<body>
    <h2>border-image-repeat: stretch;</h2>
</body>
</html>

Output: 

Example: In this example, we are using border-image-repeat: repeat; property.




<!DOCTYPE html>
<html>
<head>
    <title>
        CSS border-image-repeat Property
    </title>
 
    <!-- CSS property -->
    <style>
        h2 {
            border: 20px solid transparent;
            padding: 20px;
            border-image-source:
            border-image-repeat: repeat;
            border-image-slice: 40;
            text-align: center;
        }
    </style>
</head>
<body>
    <h2>border-image-repeat: repeat;</h2>
</body>
</html>

Output:

Example: In this example, we are using border-image-repeat: round; property.




<!DOCTYPE html>
<html>
<head>
    <title>
        CSS border-image-repeat Property
    </title>
 
    <!-- CSS property -->
    <style>
        h2 {
            border: 20px solid transparent;
            padding: 20px;
            border-image-source:
            border-image-repeat: round;
            border-image-slice: 40;
            text-align: center;
        }
    </style>
</head>
 
<body>
    <h2>border-image-repeat: round;</h2>
</body>
</html>

Output:

Example:  In this example, we are using border-image-repeat: initial; property.




<!DOCTYPE html>
<html>
<head>
    <title>
        CSS border-image-repeat Property
    </title>
 
    <!-- CSS property -->
    <style>
        h2 {
            border: 20px solid transparent;
            padding: 20px;
            border-image-source:
            border-image-repeat: initial;
            border-image-slice: 40;
            text-align: center;
        }
    </style>
</head>
 
<body>
    <h2>border-image-repeat: initial;</h2>
</body>
</html>

Output: 

Supported Browsers: The browser supported by border-image-repeat property are listed below:


Article Tags :