outline

A shorthand property for setting the width, style, and color of an element's outline. Outlines are drawn outside the border edge and don't take up space.

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

/* Usage Example */
button:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 4px;
  /* accessible focus style that doesn't trigger layout shifts */
}

/* Syntax */
outline: outline-width;
outline: outline-style;
outline: outline-color;

/* Global values */
outline: inherit;
outline: initial;
outline: revert;
outline: revert-layer;
outline: unset;
Widely available Since 2023 94% global usage

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

94+
88+
16.4+
94+
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