Coding With Fun
Home Docker Django Node.js Articles Python pip guide FAQ Policy

CSS outline property


May 06, 2021 CSS Reference Manual


Table of contents


CSS outline property


Set the outline around the element:

p
{
outline:#00FF00 dotted thick;
}

Try it out . . .

Description of property definition and use

Outline is a line drawn around an element that is located on the periphery of the edge of the border and serves as a prominent element.

Outline short-case properties set all contour properties in one declaration.

The properties that can be set are (in order): outline-color, outline-style, outline-width

If you don't set one of these values, there's no problem, such as outline:solid #ff0000; It is also allowed.

Default: invert none medium
Inherited: no
Version: CSS2
JavaScript syntax: object .style.outline="#0000FF dotted thin"


Browser support

The numbers in the table support the first browser version number of the property.

Attributes
outline 1.0 8.0 1.5 1.2 7.0

The property value

Value Describe
outline-color Specify the color of the border. See also: Possible values in outline-color.
outline-style Specify the style of the border. See also: Possible values in outline-style.
outline-width Specifies the width of the border. See also: Possible values in outline-width.
inherit Specifies that the settings of the outline property should be inherited from the parent element.


Related articles

CSS tutorial: CSS Outline