More “Try it Yourself” examples below.
Definition and Usage
The border-left-color property sets the color of an element’s left border.
Note: Always declare the border-style or the border-left-style property before the border-left-color property. An element must have a border before you can change the color.
| Default value: | The current color of the element |
|---|---|
| Inherited: | no |
| Animatable: | yes. Read about animatable – Try it |
| Version: | CSS1 |
| JavaScript syntax: | object.style.borderLeftColor=”blue” Try it |
CSS Syntax
border-left-color: color|transparent|initial|inherit;
Property Values
| Value | Description | Play it |
|---|---|---|
| color | Specifies the color of the left border. Look at CSS Color Values for a complete list of possible color values. Default color is the color of the element | div { border-style:solid; border-width:5px; border-left-color:#D6S497; } |
| transparent | Specifies that the border color should be transparent | div { border-style:solid; border-width:5px; border-left-color:transparent ; } |
| initial | Sets this property to its default value. Read about initial | div { border-style:solid; border-width:5px; border-left-color:initial; } |
| inherit | Inherits this property from its parent element. Read about inherit |
Example
Set a color for the left border with a HSLA value:
div {border-left-color: hsla(89, 43%, 51%, 0.3);}
