Move the ouline border 15 pixels outside the border edge:
document.getElementById("myDIV").style.outlineOffset = "15px";
Try it Yourself »
The outlineOffset property offsets an outline, and draws it beyond the border edge.
Outlines differ from borders in two ways:
Property | |||||
---|---|---|---|---|---|
outlineOffset | Yes | 15.0 | Yes | Yes | Yes |
Return the outlineOffset property:
object.style.outlineOffset
Set the outlineOffset property:
object.style.outlineOffset
= "length|initial|inherit"
Value | Description |
---|---|
length | The distance the outline is outset from the border edge. Default value is 0 |
initial | Sets this property to its default value. Read about initial |
inherit | Inherits this property from its parent element. Read about inherit |
Default Value: | 0 |
---|---|
Return Value: | A String, representing the outline-offset property of an element |
CSS Version | CSS3 |
CSS reference: outline-offset property
截取页面反馈部分,让我们更快修复内容!也可以直接跳过填写反馈内容!