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
<!DOCTYPE html> <html> <head> <style> div{ margin:20px; width:150px; padding:10px; height:70px; border:2px solid black; outline:2px solid red; outline-offset:15px;} </style> </head> <body> <p><b>注釋:</b>Internet Explorer 和 Opera 不支持 support outline-offset 屬性。</p> <div>這個 div 在邊框邊緣之外 15 像素處有一個輪廓。</div> </body> </html>
Run instance ?
Click the "Run instance" button to view the online instance