The outline-width property sets the thickness of an element’s outline. An outline is drawn outside the border and does not take up layout space.
Use a keyword (thin, medium, thick) or a length such as 2px. The initial value is medium, but the outline stays invisible until outline-style is a visible style such as solid. Pair width with style and outline-color, or use the outline shorthand.
Baseline · Widely available.
Not deprecated. Keywords and length values are standard-track and widely supported. The newer hairline keyword from CSS Borders Level 4 is still limited — prefer 1px or thin in production for now.
Set a font size.font-size: 16px is the base for em.
Use a relative width.0.25em becomes 4px here (0.25 × 16).
Keep style and color. Solid purple shows the scaled ring clearly.
Change the font, change the outline. If the font size grows, the outline grows with it.
Edge Cases & Pitfalls
If the outline disappears or looks wrong, check these first.
style
Width alone does not draw
The default outline-style is none. Set a visible style such as solid, or use the outline shorthand with a style keyword.
layout
Thicker outlines do not push content
Unlike border-width, growing an outline never changes the element’s size. Neighbors stay put even with 8px or thick.
double
double shares the total width
With outline-style: double, both lines and the gap between them use the same outline-width. A thin width can look like a single line — try 6px or more.
a11y
Keep focus rings thick enough
Very thin outlines are easy to miss. For keyboard focus, prefer at least about 2px with clear contrast, often with a small outline-offset.
hairline
hairline is still limited
The newer hairline keyword means a just-visible line of 1px or less. Prefer 1px or thin until support is universal.
Compatibility
Browser Support
outline-width is a browser CSS property for outline thickness. Node.js, Deno, and Bun do not apply it.
✓ Baseline · Widely available
outline-width
Supported in Chrome 4+, Firefox 2+, Safari 3.1+, Edge 12+, and Internet Explorer 8+. Keywords thin, medium, and thick 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-widthWidely supported
Bottom line: Safe for focus and emphasis styling in current browsers. Remember that a visible outline-style is still required. It is not a runtime API.
Remember
Key Takeaways
Role: sets how thick the outline is around an element.
Initial value:medium. Still needs a visible outline-style to show.
Values:thin, medium, thick, or any non-negative length.
No layout shift: thicker outlines never change the element’s size.
One line: set a visible style first, then choose the width — width alone stays invisible.
Frequently Asked Questions
It sets how thick an element's outline is, using keywords such as thin, medium, and thick, or a length such as 2px. The outline sits outside the border and does not change layout.
The initial value is medium, which is typically about 3px. The outline still stays invisible until outline-style is a visible style such as solid.
outline-style defaults to none. Set a visible style first, or use the outline shorthand with a style keyword. A width alone is not enough.
No. Outlines are drawn outside the border box and never take up space, so neighboring content does not shift when the outline grows thicker.
They accept similar keywords and lengths, but outline-width never changes the box model. border-width is part of the element's size.
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.