HTML DOM Style outlineOffset Property
THE WORLD'S LARGEST WEB DEVELOPER SITE

Style outlineOffset Property

❮ Style Object

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 Not supported 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


❮ Style Object