English | 简体中文 | 繁體中文 | Русский язык | Français | Español | Português | Deutsch | 日本語 | 한국어 | Italiano | بالعربية

CSS Reference Manual

CSS @rules (RULES)

Comprehensive CSS Attributes

CSS outline-tab

outline-size Attributeoutlinewidth Attribute Usage and Example

width CSS attribute sets the width of the element outline. However, in many cases, the shorthand CSS attribute

More convenient to use and preferable.medium
The following table provides usage instructions and version history of this attribute, as well as its usage syntax in JavaScript scripts.Default Value:
Applicable To:All Elements
Inheritance:NoAnimatable: Yes..
Please refer toAnimation Attribute 2Version:3
CSS,object

outline-.style.outlineWidth="medium"

width Syntax Usage

outline-The syntax of this attribute is as follows:

width: thin | medium | thick | length | initial | inherit-The following examples demonstrate how to use outline

  Example
   outline-p {
   outline-style: solid;
  width: thick;
}/Test to see‹

Note:-width Attribute must be declared beforeoutline-styleAttribute. The element must have an outline before the width of the outline can be set, because the outline-The default value of the style attribute is none.

Attribute Value

The following table describes the values of this attribute.

ValueDescription
thinThin Outline.
mediumMedium Outline.
thickThick Outline.
lengthNumeric values in units such as px, em, etc. Negative values are not allowed.
inheritIf specified, the associated element adopts the outline of its parent element-width Attribute Value.

Browser Compatibility

outline-Browser Compatibility of width Attribute; the numbers in the table below represent the minimum version number of browsers that support this attribute; all mainstream browsers support this attribute.

  • Firefox 1.5Above

  • Google Chrome1+

  • Internet Explorer 8+

  • Apple Safari 1.2+

  • Opera 7+

Warning: Internet Explorer 7and earlier versions do not support this outline-width Attribute. IE8Supports this attribute, but requires an effective<!DOCTYPE>.

Further Reading

Please refer to the tutorials related to the following content:CSS Outline,CSS Border.

Related Attributes:outline,outline-style,outline-color.