## border-image-slice 屬性
border-image-slice 屬性規定圖像邊框的向內偏移。
JavaScript 語法:object.style.borderImageSlice="50% 50%"
## 語法
~~~
border-image-slice: number|%|fill;
~~~
注釋:該屬性規定圖像的上、右、下、左側邊緣的向內偏移,圖像被分割為九個區域:四個角、四條邊以及一個中間區域。除非使用了關鍵詞 fill,否則中間的圖像部分會被丟棄。如果省略第四個數值/百分比,則與第二個值相同。如果省略第三個值,則與第一個值相同。如果省略第二個值,則與第一個值相同。
| 值 | 描述 |
| --- | --- |
| *number* | 數字值,代表圖像中像素(如果是光柵圖像)或矢量坐標(如果是矢量圖像)。 |
| *%* | 相對于圖像尺寸的百分比值:圖像的寬度影響水平偏移,高度影響垂直偏移。 |
| fill | 保留邊框圖像的中間部分。 |
## 實例--規定圖像邊框的向內偏移:
~~~
div
{
border-image-source: url(border.png);
border-image-slice: 50% 50%;
}
~~~
- CSS常用樣式控制
- background--背景
- Text--文本
- CSS屬性
- align-*
- animation-*
- appearance
- backface-visibility
- background
- background-attachment
- background-blend-mode
- background-clip
- background-color
- background-image
- background-origin
- background-position
- background-repeat
- background-size
- border
- border-bottom
- border-bottom-color
- border-bottom-left-radius
- border-bottom-right-radius
- border-bottom-style
- border-bottom-width
- border-collapse
- border-color
- border-image
- border-image-outset
- border-image-repeat
- border-image-source
- border-image-width
- Border-left
- border-left-color
- border-left-style
- border-left-width
- border-image-slice
- border-radius
- border-right
- border-right-color
- border-right-style
- border-right-width
- border-spacing
- border-style
- border-top
- border-top-color
- border-top-left-radius
- border-top-right-radius
- border-top-style
- border-top-width
- border-width
- bottom
- box-shadow
- box-sizing
- caption-side
- clear
- clip
- color
- column-count
- column-gap
- column-rule
- column-rule-color
- column-rule-style
- column-rule-width
- column-span
- column-width
- columns
- content
- counter-increment
- counter-reset
- cursor
- direction
- display
- Empty-cells
- filter(濾鏡)
- CSS 偽元素選擇器
- :active 選擇器
- :after 選擇器
- :before 選擇器
- :checked 選擇器
- :disabled 選擇器
- :empty 選擇器
- :enabled 選擇器
- :first-child 偽元素
- :first-letter 偽元素
- :first-line 偽元素
- :first-of-type 選擇器
- :focus 選擇器
- :hover 選擇器