Use an image as the border around a div element:
document.getElementById("myDIV").style.borderImageSource = "url(border.png)";
Try it Yourself »
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.
The numbers in the table specify the first browser version that fully supports the property.
Property | |||||
---|---|---|---|---|---|
borderImageSource | Yes | 11.0 | Yes | 6.0 | 15.0 |
Look at the borderImage property instead!
Return the borderImageSource property:
object.style.borderImageSource
Set the borderImageSource property:
object.style.borderImageSource = "none|
image|initial|inherit"
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 |
Default Value: | none |
---|---|
Return Value: | A String, representing the border-image-source property of an element |
CSS Version | CSS3 |
CSS reference: border-image-source property
截取页面反馈部分,让我们更快修复内容!也可以直接跳过填写反馈内容!