HTML DOM Style borderImage Property Last Updated : 15 Jun, 2023 Comments Improve Suggest changes Like Article Like Report The DOM Style borderImage Property in HTML is a shorthand property used for setting the borderImageSource, borderImageSlice, borderImageWidth,borderImageOutset, and borderImageRepeat properties. Syntax: It is used to return the borderImage property. object.style.borderImageIt is used to set the borderImage property. object.style.borderImage = "source slice width outset repeat| initial|inherit" Property Values: In the borderImage property there is 7 property value which is mentioned above described below: border-Image-Source: This parameter holds the source image that will be used.border-Image-Slice: This parameter specifies the inward offsets of the image-border.border-Image-Width: This parameter holds the width of the used image border.border-Image-Outset: This parameter defines which of the border area should be extended.border-Image-Repeat: This parameter defines that the border should be repeated, rounded, or stretched.initial: This property value is used to set this property to its default value.inherit: This property value is used to inherit this property from its parent element. Return Values: It returns a string value that represents the border-image property of an element. Example 1: This show how to change the border-image. HTML <!DOCTYPE html> <html> <head> <style> #my { border: 50px solid transparent; width: 250px; padding: 15px 15px; -webkit-border-image: url(https://media.geeksforgeeks.org/wp-content/uploads/bord-1-300x161.jpg) 100 100 stretch; -o-border-image: url(https://media.geeksforgeeks.org/wp-content/uploads/bord-1-300x161.jpg) 100 100 stretch; border-image: url(https://media.geeksforgeeks.org/wp-content/uploads/bord-1-300x161.jpg) 100 100 stretch; } </style> </head> <body> <h3> Click the "Change" button to change the border-image property </h3> <button onclick="myFunction()">Change</button> <div id="my"> <h1> <font color="green">GeeksForGeeks</font> </h1> </div> <script> function myFunction() { // Code for Safari 5 document.getElementById("my").style.WebkitBorderImage = "url(https://media.geeksforgeeks.org/wp-content/uploads/bord1-1-300x162.jpg)30 30 round"; // < !--Code for Opera 12 -- > document.getElementById("my").style.OBorderImage = "url(https://media.geeksforgeeks.org/wp-content/uploads/bord1-1-300x162.jpg)30 30 round"; document.getElementById("my").style.borderImage = "url(https://media.geeksforgeeks.org/wp-content/uploads/bord1-1-300x162.jpg)30 30 round"; } </script> </body> </html> Output: Example 2: Style borderImageSource Property. HTML <!DOCTYPE html> <html> <head> <style> div { border: 30px solid transparent; border-image: url(https://media.geeksforgeeks.org/wp-content/uploads/bord1-1-300x162.jpg); border-image-slice: 30; border-image-width: 1 1 1 1; border-image-outset: 0; border-image-repeat: round; } </style> </head> <body> <h3>Here are the two images used:</h3> <img src= "https://media.geeksforgeeks.org/wp-content/uploads/bord-1-300x161.jpg" height="100" width="100"> <img src= "https://media.geeksforgeeks.org/wp-content/uploads/bord1-1-300x162.jpg" height="100" width="100"> <div id="main"> <h1><center><font color="green" > GeeksForGeeks </font></center></h1> </div> <h3> Click the "Change" button to change the value of the borderImageSource property. </h3> <button onclick="myFunction()">Change</button> <script> function myFunction() { document.getElementById("main").style.borderImageSource = "url(https://media.geeksforgeeks.org/wp-content/uploads/bord-1-300x161.jpg)"; } </script> </body> </html> Output: Supported Browsers: The browser supported by DOM Style borderImage Property are listed below: Google Chrome 16.0Edge 12.0Internet Explorer 11.0Firefox 15.0Opera 11.0Safari 6.0 Comment More infoAdvertise with us Next Article HTML DOM Style borderImage Property S SHUBHAMSINGH10 Follow Improve Article Tags : Web Technologies HTML Web technologies HTML-DOM HTML-Property +1 More Similar Reads HTML DOM Underline Object The DOM underline object is used to represent the HTML <u> element. The underline element is accessed by getElementById(). Syntax: document.getElementById("id"); Where 'id' is the ID assigned to the <u> tag. Example 1: In this example, we will use the DOM underline object. HTML <!DOCT 1 min read HTML DOM Kbd Object The Kbd Object in HTML DOM is used to represent the HTML <kbd> element. The <kbd> tag is the phrase tag and is used to define the keyboard input. The text enclosed by the <kbd> tag is typically displayed in the browserâs default monospace font. The <kbd> element can be access 2 min read HTML DOM Italic Object The Italic Object in HTML DOM is used to represent the HTML <i> element. This tag is used to display the content in italic style. The <i> element can be accessed by using the getElementById() method. Syntax: document.getElementById("id"); Where id is assigned to the <i> tag. Exampl 1 min read HTML DOM HashChangeEvent The HashChangeEvent in HTML DOM is an interface between the events that are triggered when the hash of the URL has been changed. The anchor part of the URL follows the # symbol. Supported Tags <body> Properties/Methods: newURL: This property is used to return the URL of the document after the 2 min read HTML DOM removeAttributeNode() Method The DOM removeAttributeNode() method is used to remove the specified attribute from the current element. It is similar to removeAttribute() method but the difference is that the removeAttribute method is used to remove the attribute with the specified name, but on the other hand removeAttributeNode 1 min read HTML DOM Superscript Object The superscript object in HTML DOM is used to represent the HTML <sup> element. The superscript element can be accessed by using getElementById(). Syntax: document.getElementById("id") Where id is assigned to the <sup> tag. Example: In this example, we will use DOM Superscript Object HTM 1 min read HTML DOM replaceChild() Method The replaceChild() method in HTML DOM is used to replace a child node with a new node within the given parent node. Syntax: parentNode.replaceChild( newChild, oldChild ) Parameter Values: This method accepts two parameters which are listed below: newChild: It is the required parameter. It represents 1 min read HTML DOM Subscript Object The Subscript Object in HTML DOM is used to represent the HTML <sub> element. The subscript element can be accessed by using the getElementById() method. Syntax: document.getElementById("id") Where id is assigned to the <sub> tag. Example 1: In this example, we will use DOM Subscript Obj 1 min read HTML | DOM Fieldset Object The DOM Fieldset Object is used to represent the HTML <fieldset> element. The fieldset element is accessed by getElementById(). Properties: disabled: disabled property used to set or return whether a fieldset is disabled, or not.form: use to return a reference to the form that contains the fie 2 min read HTML DOM Figure Object The DOM Figure Object is used to represent the HTML <figure> element. The figure element is accessed by getElementById(). Syntax: document.getElementById("ID"); Where âidâ is the ID assigned to the âfigureâ tag. Example 1: In this example, we will use DOM Figure Object. HTML <!DOCTYPE html 2 min read Like