outline-offset
CSS property sets the amount of space between an
outline
and the edge or border of an element.
/* <length> values */ outline-offset: 3px; outline-offset: 0.2em; /* Global values */ outline-offset: inherit; outline-offset: initial; outline-offset: unset;
<length>
0
places the outline so that there is no space between it and the element.
An outline is a line that is drawn around an element, outside the border edge. The space between an element and its outline is transparent. In other words, it is the same as the parent element's background.
| 初始值 |
0
|
|---|---|
| 适用于 | 所有元素 |
| 继承 | no |
| 计算值 | as specified, but with relative lengths converted into absolute lengths |
| 动画类型 | a length |
<length>
<p>Gallia est omnis divisa in partes tres.</p>
p {
outline: 1px dashed red;
outline-offset: 10px;
background: yellow;
border: 1px solid blue;
margin: 15px;
}
| 规范 | 状态 | 注释 |
|---|---|---|
|
CSS Basic User Interface Module Level 3
The definition of 'outline-offset' in that specification. |
推荐 | 初始定义 |
| Desktop | Mobile | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|
outline-offset
|
Chrome 完整支持 1 | Edge 完整支持 15 | Firefox 完整支持 1.5 | IE 不支持 No | Opera 完整支持 9.5 | Safari 完整支持 1.2 | WebView Android 完整支持 37 | Chrome Android 完整支持 18 | Firefox Android 完整支持 4 | Opera Android 完整支持 14 | Safari iOS 完整支持 1 | Samsung Internet Android 完整支持 1.0 |
完整支持
不支持