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

CSS3 border-image-slice property

CSS3 border-image-slice property

Example

Specify the inward offset of the image border:

div

{

border-image-source:

url

(

border

.

png

)

;

border-image-slice:

50

%

50

%

;

}


Browser support

The numbers in the table indicate the first browser version that supports this property.

property
border-image-slice 15.0 11.0 15.0 6.0 15.0

Property definition and usage

The border-image-slice property specifies the inward offset of the image border.

Default value: 100%
Inherited: no
Version: CSS3
JavaScript syntax: object.style.borderImageSlice="50% 50%"

Syntax

border-image-slice:

number

|

%

|fill;

Note: This property specifies the inward offsets of the top, right, bottom, and left edges of the image, dividing it into nine regions: four corners, four edges, and the middle. The middle part of the image is discarded (treated as fully transparent) unless the keyword is filled in. If the fourth number/percentage is omitted, it is the same as the second. If the third is also omitted, it is the same as the first. If the second is also omitted, it is the same as the first.

Value Description
number A number represents pixels of the image (for bitmap images) or coordinates of the vector (if the image is a vector image)
% Percentages are relative to the size of the image: the horizontal offset is relative to the width, the vertical offset to the height
fill Preserve the middle part of the image