outline

Overview

UK[ˈaʊtlaɪn] US[ˈaʊtˌlaɪn]

offset

Offset

UK[ˈɒfset] US[ˈɔ:fset]

css outline-offset property syntax


How to use the outline-offset attribute?

Theoutline-offset property sets the distance between the outline and the edge of the border. Basic syntax: outline-offset:length; indicates that the distance between the outline and the border is length. The unit of length can be an absolute unit (such as px) or a relative unit (such as %).

Function:The outline-offset property offsets the outline and draws it on the edge of the border. Outlines differ from borders in two ways: outlines take up no space, and outlines may be non-rectangular.

Syntax:outline-offset: length|inherit;

Description:length Outline and border edge distance. Inherit specifies that the value of the outline-offset attribute should be inherited from the parent element.

Note:All major browsers support the outline-offset attribute, except Internet Explorer.

css outline-offset property example

    

注释:Internet Explorer 和 Opera 不支持 support outline-offset 属性。

这个 div 在边框边缘之外 15 像素处有一个轮廓。

Run instance »

Click the "Run instance" button to view the online instance