CSS border image slice is used to slice the border image from top, left, bottom and right.
This divides border into nine parts: four corners, four edges and the middle.
Syntax
1 |
border-image-slice: specify slice value here in numeric. |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 |
<style> .div-border{ border-image-source: url(../../images/myborder.png); border-image-slice: 14; border-image-width: 0.5em 0.87em; border-image-outset: 0em 0.9em 1.2em 0.9em; border-image-repeat: round; border-width:12px; border-style:solid; border-color:#000; } </style> <div class="div-border"> <p>This is the paragraph inside the div with border images sliced.</p> </div> |
Output
This is the paragraph inside the div with border images sliced.
CSS border image slice values list
Sr. No. | value | Description |
---|---|---|
1 | value | Used to specify the value in px, percentage. The value for this for example 40. |
2 | fill | Used to show the middle part of the image. |
3 | initial | Used to define as the property initial value. |
4 | inherit | Used to define the computed value of property on the elements parent. |
5 | unset | Used to define the property either acts as inherit or initial, depending on the property if it is inherited or not. |