Style outlineOffset Property
Example
Move the ouline border 15 pixels outside the border edge:
document.getElementById("myDIV").style.outlineOffset = "15px";
Try it Yourself »
Definition and Usage
The outlineOffset property offsets an outline, and draws it beyond the border edge.
Outlines differ from borders in two ways:
- Outlines do not take up space
- Outlines may be non-rectangular
Browser Support
Property | |||||
---|---|---|---|---|---|
outlineOffset | Yes | 15.0 | Yes | Yes | Yes |
Syntax
Return the outlineOffset property:
object.style.outlineOffset
Set the outlineOffset property:
object.style.outlineOffset = "length|initial|inherit"
Property Values
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 |
Technical Details
Default Value: | 0 |
---|---|
Return Value: | A String, representing the outline-offset property of an element |
CSS Version | CSS3 |
Related Pages
CSS reference: outline-offset property