outline-offset

这篇翻译不完整。请帮忙从英语翻译这篇文章

概要

outline-offset CSS 属性用于设置 outline 与一个元素边缘或边框之间的间隙。

An outline is a line that is drawn around elements, outside the border edge.

初始值0
适用元素all elements
是否是继承属性
适用媒体visual, interactive
计算值as specified, but with relative lengths converted into absolute lengths
Animation typea length
正规顺序the unique non-ambiguous order defined by the formal grammar

The space will be transparent (the parent will determine the background).

Syntax

/* <length> values */
outline-offset: 3px;
outline-offset: 0.2em;

/* Global values */
outline-offset: inherit;
outline-offset: initial;
outline-offset: unset;

Values

<length>
The width of the space. See <length> for possible units. Negative values place the outline inside the element.

Formal syntax

<length>

Examples

p {
  outline: dashed thin;
  /* Move the outline 10px away from the border */
  outline-offset: 10px;
  border:1px solid black;
}

Html

<p>outline: offset 10px. Border is solid and outline is dashed</p>

The code above produces this effect:

Another example:

outline: multiple offsets;

Specifications

Specification Status Comment
CSS Transitions
outline-offset
Working Draft Defines outline-offset as animatable.
CSS Basic User Interface Module Level 3
outline-offset
Candidate Recommendation Initial definition

Browser compatibility

Feature Chrome Firefox (Gecko) Internet Explorer Opera Safari (WebKit)
Basic support 1.0 1.5 (1.8) 未实现 9.5 1.2
Feature Android Firefox Mobile (Gecko) IE Phone Opera Mobile Safari Mobile
Basic support ? ? ? ? ?

文档标签和贡献者

标签: 
 此页面的贡献者: xgqfrms-GitHub
 最后编辑者: xgqfrms-GitHub,