border-image-slice
Baseline
Widely available
This feature is well established and works across many devices and browser versions. Itâs been available across browsers since иÑÐ»Ñ 2015 г..
ÐпиÑание
CSS-ÑвойÑÑво border-image-slice Ð´ÐµÐ»Ð¸Ñ Ð¸Ð·Ð¾Ð±Ñажение Ñказанное в border-image-source на девÑÑÑ Ð¾Ð±Ð»Ð°ÑÑей: ÑеÑÑÑе Ñгла, ÑеÑÑÑе кÑÐ°Ñ Ð¸ ÑеÑединÑ. ÐÑо пÑоиÑÑ
Ð¾Ð´Ð¸Ñ Ð¿ÑÑÑм ÑÐºÐ°Ð·Ð°Ð½Ð¸Ñ 4 внÑÑÑенниÑ
ÑмеÑений.
ЧеÑÑÑе знаÑÐµÐ½Ð¸Ñ ÑпÑавлÑÑÑ Ð¿Ð¾Ð»Ð¾Ð¶ÐµÐ½Ð¸ÐµÐ¼ линий ÑÑеза. If some are not specified, they are inferred from the other with the usual 4-value syntax of CSS.
The middle is not used by the border itself but is used as a background-image if the keyword fill is set. The keyword can be set at any position in the property (before, after or between the other values).
The border-image-repeat, border-image-width, border-image-outset properties define how these images will be used.
The shorthand CSS property border-image may reset this property to its default value.
| ÐаÑалÑное знаÑение | 100% |
|---|---|
| ÐÑименÑеÑÑÑ Ðº | вÑе ÑлеменÑÑ, кÑоме внÑÑÑенниÑ
ÑаблиÑнÑÑ
ÑлеменÑов, когда border-collapse:collapse. ÐÑо Ñакже пÑименÑеÑÑÑ Ðº ::first-letter. |
| ÐаÑледÑеÑÑÑ | Ð½ÐµÑ |
| ÐÑоÑенÑÑ | оÑноÑÑÑÑÑ Ðº ÑазмеÑÑ Ñамки изобÑÐ°Ð¶ÐµÐ½Ð¸Ñ |
| ÐбÑабоÑка знаÑÐµÐ½Ð¸Ñ | одно к ÑеÑÑÑÑм пÑоÑенÑам (как Ñказано) или абÑолÑÑной длине(ам), плÑÑ ÐºÐ»ÑÑевое Ñлово fill, еÑли Ñказано |
| Animation type | by computed value type |
СинÑакÑиÑ
/* border-image-slice: slice */
border-image-slice: 30%;
/* border-image-slice: horizontal vertical */
border-image-slice: 10% 30%;
/* border-image-slice: top horizontal bottom */
border-image-slice: 30 30% 45;
/* border-image-slice: top right bottom left */
border-image-slice: 7 12 14 5;
/* border-image-slice: ⦠fill */
/* The fill value can be placed between any value */
border-image-slice: 10% fill 7 12;
/* ÐлобалÑнÑе знаÑÐµÐ½Ð¸Ñ */
border-image-slice: inherit;
border-image-slice: initial;
border-image-slice: unset;
ÐнаÑениÑ
- slice
-
Is a
<number>or a<percentage>of the offset for the four slicing lines. Note that a<length>value is not allowed, and therefore invalid. The<number>represents pixels for raster images and coordinates for vector images. Also,<percentage>values are relative to the height or width of the image, whichever is adequate. Negative values are invalid and values greater than the relevant size, height or width, are clamped to100%. - horizontal
-
Is a
<number>or a<percentage>of the offset for the two horizontal slicing lines, the top and the bottom ones. Note that a<length>value is not allowed, and therefore invalid. The<number>represents pixels for raster images and coordinates for vector images. Also,<percentage>values are relative to the height or width of the image, whichever is adequate. Negative values are invalid and values greater than the relevant size, height or width, are clamped to100%. - vertical
-
Is a
<number>or a<percentage>of the offset for the two vertical slicing lines, the right and the left ones. Note that a<length>value is not allowed, and therefore invalid. The<number>represents pixels for raster images and coordinates for vector images. Also,<percentage>values are relative to the height or width of the image, whichever is adequate. Negative values are invalid and values greater than the relevant size, height or width, are clamped to100%. - top
-
Is a
<number>or a<percentage>of the offset for the top slicing line. Note that a<length>value is not allowed, and therefore invalid. The<number>represents pixels for raster images and coordinates for vector images. Also,<percentage>values are relative to the height or width of the image, whichever is adequate. Negative values are invalid and values greater than the relevant size, height or width, are clamped to100%. - bottom
-
Is a
<number>or a<percentage>of the offset for the bottom slicing line. Note that a<length>value is not allowed, and therefore invalid. The<number>represents pixels for raster images and coordinates for vector images. Also,<percentage>values are relative to the height or width of the image, whichever is adequate. Negative values are invalid and values greater than the relevant size, height or width, are clamped to100%. - right
-
Is a
<number>or a<percentage>of the offset for the right slicing line. Note that a<length>value is not allowed, and therefore invalid. The<number>represents pixels for raster images and coordinates for vector images. Also,<percentage>values are relative to the height or width of the image, whichever is adequate. Negative values are invalid and values greater than the relevant size, height or width, are clamped to100%. - left
-
Is a
<number>or a<percentage>of the offset for the left slicing line. Note that a<length>value is not allowed, and therefore invalid. The<number>represents pixels for raster images and coordinates for vector images. Also,<percentage>values are relative to the height or width of the image, whichever is adequate. Negative values are invalid and values greater than the relevant size, height or width, are clamped to100%. fill-
Is a keyword whose presence forces the use of the middle image slice to be displayed over the background image, its size and height are resized like those of the top and left image slices, respectively.
inherit-
Is a keyword indicating that all four values are inherited from their parent's element calculated value.
ФоÑмалÑнÑй ÑинÑакÑиÑ
border-image-slice =
[ <number [0,â]> | <percentage [0,â]> ]{1,4} &&
fill?
СпеÑиÑикаÑии
| Specification |
|---|
| CSS Backgrounds and Borders Module Level 3 > # border-image-slice > |