outline
Widely availableSince 202397% of users
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.
What's modern
From web-features, MDN's browser data and our snippets, checked dailyModernIn every major browser since March 2023. Widely available since September 2025.
The old way and the modern waySee the snippet: Rounded focus rings without box-shadow hacks →
Old way 7 lines
button {
border-radius: 999px;
}
button:focus {
outline: none;
box-shadow: 0 0 0 3px #fff, 0 0 0 5px var(--focus-color);
}Modern 7 lines
button {
border-radius: 999px;
}
button:focus-visible {
outline: 2px solid var(--focus-color);
outline-offset: 3px;
}See how modern your own CSS is.Check your CSS →
Quick facts
- Initial value
See individual properties- Inherited
- No
- Applies to
- all elements
Quick example
button:focus-visible {
outline: 3px solid var(--accent);
outline-offset: 4px;
/* accessible focus style that doesn't trigger layout shifts */
}Values
outline-widthoutline-styleoutline-coloroutline browser support
BaselineWidely availableThis feature is well established and works across many devices and browser versions. It has been available across browsers since 2023.Safe to use without fallbacks.
Usage97%of people can use this3% use a browser without it.
Browsers
94+
88+
16.4+
94+Mobile
94+Android
88+Android
16.4+iOS