CSS outline-style Property
Description
The outline-style property controls the visual pattern used to draw an outline around an element. An outline is a line drawn outside the element’s border edge and is distinct from the border: it does not contribute to box dimensions, does not affect layout or spacing, and can overlap other content. Because it’s separate from the element’s box model, changing the outline style changes only how that external line looks, not how the element sizes or reflows.
The appearance you get from outline-style is combined with the outline’s color and thickness to produce the final outline; those aspects are controlled by outline-color and outline-width respectively. You can also separate the outline away from the element’s border edge using outline-offset, which shifts where the chosen style is rendered. Because the outline is rendered outside the border edge, it will typically follow the element’s outer shape (including rounded corners where supported) and is drawn on top of other content rather than reserving layout space.
From a usability and accessibility perspective, outline styling is commonly used to indicate focus for keyboard navigation and interactive controls. Designers should be cautious about removing or obscuring focus outlines without providing an equally visible alternative, since outlines play an important role for users who rely on keyboard focus indicators. Finally, because outlines do not affect hit testing or element geometry, toggling an element’s outline style won’t change its clickable area or cause layout shifts — it solely changes how that external emphasis is presented.
Definition
- Initial value
- none
- Applies to
- All elements
- Inherited
- No
- Computed value
- Specified value
- Animatable
- No
- JavaScript syntax
- object.style.outlineStyle
Interactive Demo
Syntax
outline-style: auto | <border-style> | inherit
Values
- noneOutline is not drawn, color and width are ignored.
- dottedA series of round or square dots.
- dashedThe outline is a series of short line segments.
- solidThe outline is a single line.
- doubleThe outline is two single lines. The outline-width is the sum of the two lines and the space between them.
- grooveLooks as if it were carved in the canvas. (This is typically achieved by creating a "shadow" from two colors that are slightly lighter and darker than the outline-color.)
- ridgeThe opposite of groove the outline looks as though it were coming out of the canvas.
- insetThe outline makes the box look as though it were embeded in the canvas.
- outsetThe opposite of inset the outline makes the box look as though it were coming out of the canvas.
- inherit
Example
Browser Support
The following information will show you the current browser support for the CSS outline-style 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
