Latest web development tutorials

HTML DOM Style borderImageSource property

Style Object Reference Style Objects

Examples

Use an image as a border surrounding the div element:

document.getElementById("myDIV").style.borderImageSource="url(border.png)";

try it"

Definition and Usage

borderImageSource property sets or returns the image you want to use, instead of using the border-style property given border style.

Tip: If the value is "none", or if the image is not displayed, use the border style.


Browser Support

Internet ExplorerFirefoxOperaGoogle ChromeSafari

Opera does not support borderImageSource property.

Internet Explorer version 10 and earlier are not supported borderImageSource property.

Safari version 5 and earlier do not support borderImageSource property.

See borderImage property to replace it!


grammar

Back borderImageSource properties:

object .style.borderImageSource

Setting borderImageSource properties:

object .style.borderImageSource="none|image|initial|inherit"

Property Value

描述
none 不使用图像。
image 要用于绘制边框的图像的路径。
initial 设置该属性为它的默认值。请参阅 initial
inherit 从父元素继承该属性。请参阅 inherit

technical details

Defaults: none
return value: String representing the border-image-source property element.
CSS version CSS3


related articles

CSS Reference: border-Image-Source property


Style Object Reference Style Objects