CSS Outline
An outline is a line drawn around an element, located on the periphery of the border edge, and it can play a role in highlighting the element.
The outline attribute specifies the style, color, and width of the element outline.
CSS Outline Examples
Draw a line around the element
This example demonstrates the use of the outline property draw a line around the element.
This example demonstrates how to set the style of the outline.
This example demonstrates how to set the color of the outline.
This example demonstrates how to set the width of the outline.
CSS Outline
An outline is a line drawn around an element, located on the periphery of the border edge, and can play a role in highlighting the element.
The CSS outline property specifies the style, color, and width of the element outline.
CSS Outline Properties
The (number) in the "CSS" column indicates which CSS version defines the property (CSS1 or CSS2).
Property | Description | Value | CSS |
---|---|---|---|
outline | Set all contour properties in one statement | outline-color outline-style outline-width inherit | 2 |
outline-color | Set the color of the outline | color-name hex-number rgb-number invert inherit | 2 |
outline-style | Set the style of the outline | none dotted dashed solid double groove ridge inset outset inherit | 2 |
outline-width | Set the width of the outline | thin medium thick length inherit | 2 |