English | 简体中文 | 繁體中文 | Русский язык | Français | Español | Português | Deutsch | 日本語 | 한국어 | Italiano | بالعربية
border-left-The color CSS property sets the color of the left border of the element individually. However, in many cases, it is usually more common to use shorthand CSS properties, like border-colorOrborder-leftIt's more convenient to use.
The following table provides usage instructions and version history of this attribute, as well as its usage syntax in JavaScript scripts.
Default value: | colorAttribute values |
---|---|
Applicable to: | All elements |
Inheritance: | No |
Animatable: | Yes.Please refer to Animation properties. |
Version: | CSS 1,2,3 |
JavaScript syntax: | object object.style.borderLeftColor="red" |
The syntax of this attribute is as follows:
border-left-color: color | transparent | initial | inherit
The following examples demonstrate how to use border-left-color attribute.
p { border-style: solid; border-left-color: #ff0000; }Test and see‹/›
Note:You must beborder-styleattribute border is declared before-left-The color attribute. An element must have a border before it can set the border color, becauseborder-styleThe default value of the attribute is none.
The following table describes the values of this attribute.
Value | Description |
---|---|
color | Specify the color of the top border. SeeCSS color valuesto get a list of possible color values. |
transparent | Allow the border to be transparent, although it may take upborder-widthSpace for attribute settings. |
initial | Set this attribute to its default value. |
inherit | If specified, the associated element adopts its parent element's border-left-Color attribute values. |
border-left-The compatibility of the color attribute across browsers, the numbers in the table below represent the minimum version of the browser that supports this attribute; all mainstream browsers support this attribute.
|
See tutorial:CSS Border,CSS3 Border.
Related properties:border,border-color,border-left,border-left-style,
border-left-width.