The outline-width Property in CSS

The outline-width property can be defined to draw a line of specific thickness around the borders of the element, but the outline is not a part of an element?s dimensions, unlike border property.

Syntax

The syntax of CSS outline-width property is as follows ?

Selector {
   outline-width: /*value*/
}

The value can be thin, thick, medium or a length unit.

NOTE ? The outline-style property needs to be defined before declaring outline-width.

Set a thin outline

Let?s see an example for the outline-width property. We have set a thick outline here using the thin value ?

outline-width: thin;

Example

Here is the example ?




   CSS outline-width
   


   

Set a thick outline

Let?s see an example for the outline-width property. We have set a thick outline here using the thin value ?

outline-width: thick;

Example

Here is the example ?




   CSS outline-width
   


   

Learning is fun with examples and live running code.

Set a medium outline

Let?s see an example for the outline-width property. We have set a medium outline here using the medium value ?

outline-width: medium;

Example

Here is the example ?




   


   

Demo Heading1

Demo Heading2

Demo Text

Updated on: 2024-01-02T16:27:17+05:30

60 Views

Kickstart Your Career

Get certified by completing the course

Get Started
Advertisements