目录

style borderImageSlice 属性

示例

指定图片边框的向内偏移:

document.getElementById("myDIV").style.borderImageSlice = "50% 10%";
亲自试一试 »

描述

borderImageSlice 属性指定图片边框的向内偏移。


浏览器支持

表中的数字指定完全支持该属性的第一个浏览器版本。

Property
borderImageSlice Yes 11.0 Yes 6.0 15.0

看着那(这边框图片属性代替!


语法

返回 borderImageSlice 属性:

object.style.borderImageSlice

设置 borderImageSlice 属性:

object.style.borderImageSlice = "number| %|fill|initial|inherit"

属性值

Value Description
number Numbers represent pixels in the image (if the image is a raster image) or vector coordinates (if the image is a vector image)
% Percentages are relative to the size of the image: the width of the image for the horizontal offsets, the height for vertical offsets. Default value is 100%
fill Causes the middle part of the border-image to be preserved
initial Sets this property to its default value. Read about initial
inherit Inherits this property from its parent element. Read about inherit

技术细节

默认值: 100%
返回值: 一个字符串,表示元素的 border-image-slice 属性
CSS版本 CSS3

相关页面

CSS 参考:边框图片切片属性