outline-offset

Adds space between the edge of the element and the outline. Positive values push the outline away, negative values pull it inside.

It is documented as part of the CSS Basic User Interface specification.

/* Usage Example */
a:focus {
  outline: 2px solid blue;
  /* Adds a 4px gap between the link text and the outline */
  outline-offset: 4px;
}

/* Global values */
outline-offset: inherit;
outline-offset: initial;
outline-offset: revert;
outline-offset: revert-layer;
outline-offset: unset;
Widely available Since 2017 96% global usage

This feature is well established and works across many devices and browser versions. It has been available across browsers since 2017.

1+
1.5+
1.2+
15+
Kinsta

Your first month is free

Managed WordPress hosting for faster sites.

Learn more

New CSS drops.

Join 600+ readers who've survived clearfix hacks.

ESC