Open In App

CSS border-image-width Property

The CSS border-image-width Property is used to set width of border image. It can be set by providing multiple values. 
 

Syntax: 
 



border-image-width: number | % | auto | initial | inherit;

Default Value : Its default value is 1. 

Property Values: 
 



Example 1: 
 




<!DOCTYPE html>
<html>
  
<head>
    <title>CSS|border-image-width Property</title>
    <style>
        h1,
        h2 {
            color: green;
        }
          
        #gfg {
            border: 10px solid transparent;
            padding: 15px;
            border-image-source: 
            border-image-repeat: round;
            border-image-slice: 30;
            border-image-width: 20px;
        }
    </style>
</head>
  
<body>
    <h1 id="gfg">GeeksForGeeks</h1>
    <h2 id="gfg">CSS|border-image-width Property</h2>
  
</body>
  
</html>

Output: 
 

Example 2: 
 




<!DOCTYPE html>
<html>
  
<head>
    <title>CSS|border-image-width Property</title>
    <style>
        h1,
        h2 {
            color: green;
        }
          
        #geek1 {
            border: 10px solid transparent;
            padding: 15px;
            border-image-source: 
            border-image-slice: 30;
            border-image-width: 10px 20px;
        }
          
        #geek2 {
            border: 10px solid transparent;
            padding: 10px;
            border-image-source: 
            border-image-slice: 30;
            border-image-width: 1.2rem;
        }
          
        #geek3 {
            border: 10px solid transparent;
            padding: 15px;
            border-image-source: 
            border-image-slice: 30;
            border-image-width: 10% 20% 10% 20%;
        }
    </style>
</head>
  
<body>
    <h1 id="gfg">GeeksForGeeks</h1>
    <h2 id="gfg">CSS|border-image-width Property</h2>
    <p id="geek1"> Geek one </p>
  
  
    <p id="geek2"> Geek two </p>
  
  
    <p id="geek3" style="text-align:center"> Geek three </p>
  
  
  
</body>
  
</html>
                         

Output:
 

Supported Browsers: The browser supported by border-image-width Property are listed below: 
 

 


Article Tags :