English | 简体中文 | 繁體中文 | Русский язык | Français | Español | Português | Deutsch | 日本語 | 한국어 | Italiano | بالعربية
outline-color CSS属性设置元素轮廓的颜色。然而,在许多情况下,我们更常用outlinecolor CSS attribute sets the color of the element's outline. However, in many cases, we use it more commonly
This shorthand property.
The following table provides usage instructions and version history of this attribute, as well as its usage syntax in JavaScript scripts. | invert |
---|---|
Default value: | Applies to: |
All elements | Inheritance: |
No | Animatable:Yes. Please refer to. |
Animation properties | CSS 2Version:3 |
、 | JavaScript syntax:object |
color usage syntax
outline-The syntax of this attribute is as follows:
color: color | invert | initial | inherit-The following examples demonstrate how to use outline
Example outline-p { outline-style: solid; color: #ff0000;}/Test to see‹
›Note:-attribute is declared before outlineoutline-styleThe element must have an outline before setting the outline color, because the color-The default value of styleproperty is none.
The following table describes the values of this attribute.
Value | Description |
---|---|
color | Specify the outline color.CSS color valuesto get the list of possible color values. |
invert | Perform color inversion on the screen pixels to ensure that the outline is visible regardless of the background color. This is the default value. |
initial | Set this property to its default value. |
inherit | If specified, the associated element uses its parent element's outline-color attribute values. |
outline-The compatibility of color attribute browsers, the numbers in the following table represent the minimum version number of browsers that support this attribute; all mainstream browsers support this attribute.
|
Warning: Internet Explorer 7and earlier versions do not support this outline-color attribute. IE8Supports this attribute, but requires an effective<!DOCTYPE>.
Please refer to the tutorials related to the following content:CSS outline,CSS border.
Related properties:outline,outline-width,outline-style.