CSS outline-width Property
Description
The outline-width property controls the thickness of the outline drawn around an element. It determines how prominent that outline will appear relative to the element it surrounds, so designers use it to make focus indicators, highlights, or debugging outlines more or less noticeable. Because the outline is visually separate from the element’s border, adjusting outline-width changes only the visual weight of the line and not the element’s layout or intrinsic size.
Outline appearance usually works together with other outline-related properties: its pattern comes from outline-style and its color comes from outline-color. You can think of outline-width as the weight component of that trio: style defines shape, color defines hue, and width defines thickness. In practice, authors often tune all three together to achieve a readable focus ring or a subtle debugging rim.
It’s important to understand how outlines differ from similar visual effects such as border and box-shadow. Unlike a border, an outline does not take part in the box model and therefore does not change layout, margins, or element size; unlike many shadows, outlines are a distinct stroke drawn outside the element edge and can be separated from the element by outline-offset. Because of this separation, large outline widths can overlap neighboring content visually without causing reflow.
From a design and accessibility perspective, increasing outline-width is a simple way to improve the visibility of focus indicators for keyboard and assistive technology users. However, because outlines sit outside the normal box, they can interact unexpectedly with surrounding content and stacking contexts; using offset or combining with other effects should be tested at different sizes. For dynamic effects, authors often prefer using shadows or carefully animated properties rather than animating outline width, because the visual outcome and performance characteristics can differ across complex compositions.
Definition
- Initial value
- medium
- Applies to
- All elements
- Inherited
- Yes
- Computed value
- Absolute length; '0' if the outline style is 'none'
- Animatable
- No
- JavaScript syntax
- object.style.outlineWidth
Interactive Demo
Syntax
outline-width: <border-width> | inherit
Values
- thinLess than the default width.
- thickGreater than the default width.
- mediumDefault value.
- <border-width>Floating-point number, followed by an absolute units designator (cm, mm, in, pt, or pc) or a relative units designator (em, ex, or px).
- inherit
Example
Browser Support
The following information will show you the current browser support for the CSS outline-width property. Hover over a browser icon to see the version that first introduced support for this CSS property.
This property is supported by all modern browsers.
Desktop
Tablets & Mobile
Last updated by CSSPortal on: 1st January 2026
