border-image-outset
CSS
property sets the distance by which an element's
border image
is set out from its border box.
The parts of the border image that are rendered outside the element's border box with
border-image-outset
do not trigger overflow scrollbars and don't capture mouse events.
The source for this interactive example is stored in a GitHub repository. If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request.
/* <length> value */ border-image-outset: 1rem; /* <number> value */ border-image-outset: 1.5; /* vertical | horizontal */ border-image-outset: 1 1.2; /* top | horizontal | bottom */ border-image-outset: 30px 2 45px; /* top | right | bottom | left */ border-image-outset: 7px 12px 14px 5px; /* Global values */ border-image-outset: inherit; border-image-outset: initial; border-image-outset: unset;
border-image-outset
property may be specified as one, two, three, or four values. Each value is a
<length>
or
<number>
. Negative values are invalid and will cause the
border-image-outset
declaration to be ignored.
<length>
border-image
outset as a dimension — a number with a unit.
<number>
border-image
outset as a multiple of the element's corresponding
border-width
s. For example, if an element has
border-width: 1em 2px 0 1.5rem
,和
border-image-outset: 2
, the final
border-image-outset
would be calculated as
2em 4px 0 3rem
.
| 初始值 |
0
|
|---|---|
| 适用于 |
all elements, except internal table elements when
border-collapse
is
collapse
. It also applies to
::first-letter
.
|
| 继承 | no |
| 计算值 | as specified, but with relative lengths converted into absolute lengths |
| 动画类型 | by computed value type |
[ <length> | <number> ]{1,4}
<div id="outset">This element has an outset border image!</div>
#outset {
width: 10rem;
background: #cef;
border: 1.4rem solid;
border-image: radial-gradient(#ff2, #55f) 40;
border-image-outset: 1.5; /* 1.5 × 1.4rem = 2.1rem */
margin: 2.1rem;
}
| 规范 | 状态 | 注释 |
|---|---|---|
|
CSS Backgrounds and Borders Module Level 3
The definition of 'border-image-outset' in that specification. |
候选推荐 | 初始定义 |
| Desktop | Mobile | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|
border-image-outset
|
Chrome 完整支持 15 | Edge 完整支持 12 | Firefox 完整支持 15 | IE 完整支持 11 | Opera 完整支持 15 | Safari 完整支持 6 | WebView Android 完整支持 ≤37 | Chrome Android 完整支持 18 | Firefox Android 完整支持 15 | Opera Android 完整支持 14 | Safari iOS 完整支持 6 | Samsung Internet Android 完整支持 1.0 |
完整支持
background
background-attachment
background-clip
background-color
background-image
background-origin
background-position
background-position-x
background-position-y
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-color
border-image
border-image-outset
border-image-repeat
border-image-slice
border-image-source
border-image-width
border-left
border-left-color
border-left-style
border-left-width
border-radius
border-right
border-right-color
border-right-style
border-right-width
border-style
border-top
border-top-color
border-top-left-radius
border-top-right-radius
border-top-style
border-top-width
border-width
box-shadow