Private archive copy · Unofficial site · Content copyright belongs to Runoob Tutorial and the original authors · View Original

HTML DOM Style borderImageSlice property

Style borderImageSlice property

Style Object Reference The Style object

Example

Specify the inward offset of the image border:

document.getElementById("myDIV").style.borderImageSlice="50% 10%";

Try it »


Definition and Usage

The borderImageSlice property specifies the inward offset of the image border.


Browser support

Internet Explorer Firefox Opera Google Chrome Safari

Opera does not support the borderImageSlice property.

Internet Explorer 10 and earlier versions do not support the borderImageSlice property.

Safari 5 and earlier versions do not support the borderImageSlice property.

See borderImage property as an alternative!


Syntax

Return the borderImageSlice property:

object

.style.borderImageSlice

Set the borderImageSlice property:

object

.style.borderImageSlice="

number

|

%

|fill|initial|inherit"

Attribute values

Value Description
number A number representing image pixels (if the image is a raster image) or vector coordinates (if the image is a vector image).
% A percentage relative to the size of the image: the horizontal offset refers to the image width and the vertical offset refers to the image height. The default value is 100%.
fill Keeps the middle part of the border image.
initial Sets this property to its default value. See initial.
inherit Inherits this property from its parent element. See inherit.

Technical Details

Default value: 100%
Return Value: A string representing the element's border-image-slice property.
CSS version CSS3

Related Articles

CSS Reference Manual:The border-image-slice property


Style Object Reference The Style object