CSS | outline-width Property
The outline is the line that is created around the specified element outside the border of the element to make the particular distinct and easier to distinguish.
The outline-width Property is used to specify the width of this outline for a specific element.
The outline-style property must be declared or used before the outline-width property is used on the desired element. Logically an element must have an outline for which one defines or styles the width.
The outline of an element is displayed around the margin of the element and is not the same as the border property. As the outline is not a part of the element’s dimensions, therefore the element’s width and height properties do not contain the width of the outline.
Syntax:
outline-width: medium|thin|thick|length|initial|inherit;
Property values:
- medium: This value sets the outline width to default.The width of the outline is thinner than the outline setas thick and thicker than the outline set as thin.
outline-width: medium;
<html><head><title>CSS | outline-width Property</title></head><body><pstyle = "outline-width:medium;outline-style:solid;">This paragraph has medium outline.</p></body></html>chevron_rightfilter_noneOutput:
- thin: This value sets the outline width to thin, the outline achieved is thinner than outline specified with width as medium and thick.
outline-width: thin;
<html><head><title>CSS | outline-width Property</title></head><body><pstyle = "outline-width:thin;outline-style:solid;">This paragraph has thin outline.</p></body></html>chevron_rightfilter_noneOutput:
- thick: This value sets the outline width to thick, the outline achieved is thicker than outline specified with width as medium and think.
outline-width: thick;
<!DOCTYPE html><html><head><title>CSS | outline-width Property</title></head><body><pstyle = "outline-width:thick;outline-style:solid;">This paragraph has thick outline.</p></body></html>chevron_rightfilter_noneOutput:

- length: This value is used to define the thickness of the outline.
outline-width: 15px;
<!DOCTYPE html><html><head><title>CSS | outline-width Property</title></head><body><pstyle = "outline-width:15px;outline-style:solid;">This paragraph has 15px outline.</p></body></html>chevron_rightfilter_noneOutput:
- initial: This value sets the outline -width to its default value.
outline-width: initial;
<html><head><title>CSS | outline-width Property</title></head><body><pstyle = "outline-width:initial;outline-style:solid;">This paragraph has initial outline.</p></body></html>chevron_rightfilter_noneOutput:
- inherit: This value inherits the specifications of outline-width property of parent.
outline-width: inherit;
<!DOCTYPE html><html><head><title>CSS | outline-width Property</title></head><body><pstyle = "outline-width:medium;outline-style:solid;">This paragraph has medium outline.</p><pstyle = "outline-width:thin;outline-style:solid;">This paragraph has thin outline.</p><br><pstyle = "outline-width:thick;outline-style:solid;">This paragraph has thick outline.</p><br><pstyle = "outline-width:15px;outline-style:solid;">This text has an outline of 15px.</p><br><br><pstyle = "outline-width:initial;outline-style:solid;">This text has an outline of defaulttype set by initial</p></body></html>chevron_rightfilter_none
Supported Browsers: The browser supported by CSS | outline-width Property are listed below:
- Google Chrome 1.0
- Internet Explorer 8.0
- Firebox 1.5
- Opera 7.0
- Safari 1.2
Recommended Posts:
- HTML | DOM Style outlineWidth Property
- CSS | transition-property Property
- CSS | top Property
- CSS | right Property
- CSS | nav-down property
- CSS | nav-right property
- CSS | all Property
- CSS border Property
- CSS | columns Property
- CSS | align-self Property
- CSS | resize Property
- Web API | DOMRectReadOnly x property
- CSS | flex Property
- CSS | grid-row Property
- CSS | grid-gap Property
If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to contribute@geeksforgeeks.org. See your article appearing on the GeeksforGeeks main page and help other Geeks.
Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.



