outline-style
Example
a:focus-visible {
outline-width: 2px;
outline-color: blue;
}a:focus-visible {
outline-width: 2px;
outline-style: solid;
outline-color: blue;
}The default outline-style is 'none', so width and color alone draw nothing.
Common mistakes
- The outline doesn't appear because
outline-styledefaults to 'none'. - Using 'hidden', which
outline-styledoesn't accept.
Key points
- Outlines set with longhands also set
outline-style. - Focus styles use 'solid' or 'auto', not 'none'.
Interview questions
What does outline-style: auto do?
It lets the browser draw its own native focus ring, often in the platform's accent color.
What is the default outline-style?
'none', so no outline is drawn until a style is set, except the browser's own focus ring on focus.
Can outline-style be different on each side?
No. Unlike border-style, an outline uses one style all around.
