Example
Use an image as the border around a div element:
document.getElementById("myDIV").style.borderImageSource = "url(border.png)";
Try it Yourself »
Definition and Usage
The borderImageSource property sets or returns the image to be used, instead of the border styles given by the border-style properties.
Tip: If the value is "none", or if the image cannot be displayed, the border styles will be used.
Browser Support
The borderImageSource property is not supported in Opera.
The borderImageSource property is not supported in Internet Explorer 10 and earlier.
The borderImageSource property is not supported in Safari 5 and earlier.
Look at the borderImage property instead!
Syntax
Return the borderImageSource property:
object.style.borderImageSource
Set the borderImageSource property:
object.style.borderImageSource="none|image|initial|inherit"
Property Values
Value | Description |
---|---|
none | No image will be used |
image | The path to the image to be used as a border |
initial | Sets this property to its default value. Read about initial |
inherit | Inherits this property from its parent element. Read about inherit |
Technical Details
Default Value: | none |
---|---|
Return Value: | A String, representing the border-image-source property of an element |
CSS Version | CSS3 |
Related Pages
CSS reference: border-image-source property
< Style Object