CSS PROPERTIES
Expand All|Collapse All
CSS AT-RULES
SPONSORED LINKS

CSS outline-width Property

Topic: CSS3 Properties Reference« Prev|Next »

Description

The outline-width CSS property sets the width of the outline of an element. However in many cases the shorthand CSS propertiey outline is more convenient to use and preferable.

The following table summarizes the usages context and the version history of this property.

Default value: medium
Applies to: All elements
Inherited: No
Animatable: Yes. See animatable properties.
Version: CSS 2, 3

Syntax

The syntax of the property is given with:

outline-width thin | medium | thick | length | initial | inherit

The example below shows the outline-width property in action.

  • p {
  •     outline-style: solid;
  •     outline-width: thick;
  • }
 

Note:You must declare the outline-style property before the outline-width property. An element must have outlines before you can set the width of the outline, because the default value of the outline-style property is none.


Property Values

The following table describes the values of this property.

Value Description
thin A thin outline.
medium A medium outline.
thick A thick outline.
length A length value in px, em, etc. Negative values are not allowed.
inherit If specified, the associated element takes the computed value of its parent element outline-width property.

Browser Compatibility

The outline-width property is supported in all major modern browsers.

Browsers Icon

Basic Support—

  • Firefox 1.5+
  • Google Chrome 1+
  • Internet Explorer 8+
  • Apple Safari 1.2+
  • Opera 7+
 

Warning:Internet Explorer 7 and earlier versions don't support the outline-width property. IE8 however supports this property, but requires a valid <!DOCTYPE>.


Further Reading

See tutorial on: CSS outline, CSS Border.

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

 
Close

Your Feedback:

 

We would love to hear from you! Please say something.