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

CSS Reference Manual

CSS @rules (RULES)

Comprehensive List of CSS Properties

CSS border-left-color attribute usage and example

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"

border-left-color syntax usage

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.

Attribute values

The following table describes the values of this attribute.

ValueDescription
colorSpecify the color of the top border. SeeCSS color valuesto get a list of possible color values.
transparentAllow the border to be transparent, although it may take upborder-widthSpace for attribute settings.
initialSet this attribute to its default value.
inheritIf specified, the associated element adopts its parent element's border-left-Color attribute values.

Browser compatibility

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.

  • Firefox 1+

  • Google Chrome1+

  • Internet Explorer 4+

  • Apple Safari 1+

  • Opera 4+

Read more

See tutorial:CSS Border,CSS3 Border.

Related properties:border,border-color,border-left,border-left-style,
border-left-width.