Style outlineOffset property

Definition and usage

outlineOffset The property offsets the outline and draws it outside the edge of the border.

There are two differences between the outline and the border:

  1. The outline does not take up space
  2. The outline may not be rectangular

See also:

CSS Reference Manual:outline-offset property

Example

Move the outline border 15 pixels outside the border edge:

document.getElementById("myDIV").style.outlineOffset = "15px";

Try it yourself

Syntax

Return outlineOffset property:

object.style.outlineOffset

Set outlineOffset property:

object.style.outlineOffset = "length|initial|inherit"

Property value

Value Description
length The distance from the outline to the edge of the border. The default value is 0.
initial Sets this property to its default value. See also initial.
inherit Inherits this property from its parent element. See also inherit.

Technical details

Default value: 0
Return value: A string that represents the element's outline-offset property.
CSS version: CSS3

Browser support

The numbers in the table indicate the first browser version that fully supports this attribute.

Chrome Edge Firefox Safari Opera
Chrome Edge Firefox Safari Opera
Support 15.0 Support Support Support