Style borderImageSource 屬性

定義和用法

borderImageSource 屬性設置或返回要使用的圖像,而不是由 border-style 屬性給出的邊框樣式。

提示:如果值為 "none",或者圖像無法顯示,將使用邊框樣式。

另請參閱:

CSS 參考手冊:border-image-source 屬性

實例

使用圖像作為 div 元素的邊框:

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

親自試一試

語法

返回 borderImageSource 屬性:

object.style.borderImageSource

設置 borderImageSource 屬性:

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

屬性值

描述
none 不會使用任何圖像。
image 要用作邊框的圖像的路徑。
initial 將此屬性設置為其默認值。請參閱 initial
inherit 從其父元素繼承此屬性。請參閱 inherit

技術細節

默認值: none
返回值: 字符串,表示元素的 border-image-source 屬性
CSS 版本: CSS3

瀏覽器支持

表中的數字注明了首個完全支持該屬性的瀏覽器版本。

Chrome Edge Firefox Safari Opera
Chrome Edge Firefox Safari Opera
支持 11.0 支持 6.0 15.0

請查看 borderImage 屬性