The outline-style property sets the line style of an element’s outline. An outline is drawn around the element, outside the border, and does not take up layout space.
The initial value is none, so nothing shows until you pick a visible style such as solid, dashed, or dotted. Pair it with outline-width and outline-color, or use the outline shorthand. For focus rings, solid is usually the clearest choice.
Baseline · Widely available.
Not deprecated and not experimental. Standard-track CSS Basic User Interface property. Safe for focus and emphasis styling in modern browsers.
Choose double.outline-style: double draws two parallel lines.
Share the width. The total outline-width covers both lines and the gap between them.
Use a thicker width.6px leaves room for both strokes. A thin width can look like one line.
Color both lines. Teal applies to the whole outline stroke.
Edge Cases & Pitfalls
If the outline disappears or looks wrong, check these first.
none
Default style hides everything
The initial value is none. Setting only outline-width or outline-color will not draw a line until style is visible.
a11y
Do not remove focus outlines blindly
Setting outline-style: none on :focus without a replacement makes keyboard navigation hard to follow. Keep a clear ring or provide another visible indicator.
double
double needs enough width
Two lines share the total outline-width. A thin width can make double look like a single line. Try 6px or more while learning.
layout
Outline does not affect layout
Unlike border-style, an outline never changes the element’s size. Neighboring content will not shift when the outline appears.
3D
Groove, ridge, inset, and outset depend on color
Those keywords fake a 3D edge from the outline color. On a light background with a light color they can look flat. Prefer solid for accessibility-critical focus.
Compatibility
Browser Support
outline-style is a browser CSS property for drawing outlines. Node.js, Deno, and Bun do not apply it.
✓ Baseline · Widely available
outline-style
Supported in Chrome 4+, Firefox 2+, Safari 3.1+, Edge 12+, and Internet Explorer 8+. Common values including auto are widely available.
97%Global browser support
Google Chrome4+
Full support
Mozilla Firefox2+
Full support
Apple Safari3.1+
Full support
Microsoft Edge12+
Full support
Opera15+ (Chromium)
Full support
Samsung Internet4+
Full support
Internet Explorer8+
Full support
outline-styleWidely supported
Bottom line: Safe for focus and emphasis styling in current browsers. Prefer solid for keyboard focus rings. It is not a runtime API.
Remember
Key Takeaways
Role: sets the line style of an outline drawn outside the border.
Initial value:none. A visible style is required for an outline to appear.
No layout shift: outlines never change the element’s size, unlike borders.
Focus tip: prefer solid for keyboard rings; do not remove outlines without a replacement.
One line: set a style keyword first — without it, the outline stays invisible.
Frequently Asked Questions
It sets the line style of an element's outline, such as solid, dashed, or dotted. The outline is drawn outside the border and does not take up layout space.
The initial value is none, so nothing draws until you set a visible style. Also check that outline-width is greater than zero, or use the outline shorthand.
They accept similar keywords, but outlines sit outside the border box and never change the element's size. Borders are part of the box model.
auto lets the browser draw its own outline style, often the platform focus look. It can look richer than a simple CSS keyword.
No. Setting outline-style: none on :focus without another visible focus indicator harms keyboard users. Prefer a clear solid outline, or replace it with an equally visible style.
It is Baseline Widely available: Chrome 4+, Firefox 2+, Safari 3.1+, Edge 12+, and Internet Explorer 8+. It is a browser CSS property, not a Node.js feature.