CSS outline-width Property


The outline-width CSS property is used to specify the width of the outline that surrounds an element when it gains focus or is activated. It is commonly used in conjunction with the outline-style and outline-color properties to customize the appearance of the outline. Outlines are typically used to enhance the accessibility and usability of interactive elements on a webpage, such as links and form elements, by providing a visible indication of focus without altering the layout of the page. The outline-width property accepts values in various units, such as pixels, ems, or percentages, allowing developers to control the thickness of the outline according to their design preferences and accessibility requirements.

Initial value
Applies to
All elements
Computed value
Absolute length; '0' if the outline style is 'none'
JavaScript syntax

Interactive Demo

The rusty swing set creaked a lonely lullaby in the twilight, shadows lengthening like grasping fingers across the dew-kissed grass. A lone dandelion seed, adrift on the breeze, whispered secrets of faraway fields, of dandelion suns and galaxies spun from fluff.


outline-width: <border-width> | inherit


  • 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


<div class="block">Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.</div> 
.block { 
   outline-style: dotted; 
   outline-width: 3px; 
   outline-color: blue;
   padding: 10px; 

Browser Support

The following table will show you the current browser support for the CSS outline-width property.

Edge Chrome Firefox Opera Safari
Tablets / Mobile
Chrome Firefox Opera Safari Samsung Webview

Last updated by CSSPortal on: 2nd January 2024