The border-image-slice
CSS property divides the image from border-image-source
in nine parts: the four corners, the four edges and the middle.
It controls the distance by specifying 4 inwards offsets.
border-image-slice: [<number> | <percentage>]{1,4};
One-value syntax
border-image-slice: slice E.g. border-image-slice: 30%;
Two-value syntax
border-image-slice: horizontal vertical E.g. border-image-slice: 10% 30%;
Three-value syntax
border-image-slice: top vertical bottom
E.g. border-image-slice: 30 30% 45;
Four-value syntax
border-image-slice: top right bottom left E.g. border-image-slice: 7 15 24 35;
The fill value can be placed between any value.
E.g. border-image-slice: 10% fill 7 12;
border-image-slice |
Yes | Yes | Yes | Yes | Yes |
<!DOCTYPE html>
<html>
<head>
<style>
div {<!-- w ww .j ava 2s. c om-->
background-color: lightgrey;
border: 30px solid transparent;
border-image: url('http://java2s.com/style/demo/border.png');
border-image-slice: 15%;
}
</style>
</head>
<body>
<div>
This DIV uses an image as a border.
</div>
<p>Here is the image used:</p>
<img src="http://java2s.com/style/demo/border.png"/>
</body>
</html>