CSS border-left-color Eigenschaft
- previous page border-left
- next page border-left-style
Definition and Usage
The border-left-color sets the color of the left border of the element.
Only pure colors can be defined, and the border can only appear when the border style is not none or hidden.
Note:Always declare the border-style attribute before the border-color attribute. The element must have a border before you change its color.
See Also:
CSS Tutorial:CSS Ränder
CSS Reference Manual:border-left Attribute
HTML DOM Reference Manual:borderLeftColor Property
Example
Set the color of the left border:
p { border-style:solid; border-left-color:#ff0000; }
CSS Syntax
border-left-color: color|transparent|initial|inherit;
Attribute Value
Value | Description |
---|---|
color_name | Specifies the border color with color name (e.g., red). |
hex_number | Specifies the border color with hexadecimal value (e.g., #ff0000). |
rgb_number | Specifies the border color with rgb code (e.g., rgb(255,0,0)). |
transparent | Default Value. The border color is transparent. |
inherit | Specifies that the border color should be inherited from the parent element. |
Technical Details
Default Value: | not specified |
---|---|
Inheritance: | no |
Version: | CSS1 |
JavaScript Syntax: | object.style.borderLeftColor="blue" |
More Examples
- Set the color of the left border
- This example demonstrates how to set the color of the left border.
Browser Support
The numbers in the table indicate the first browser version that fully supports this attribute.
Chrome | IE / Edge | Firefox | Safari | Opera |
---|---|---|---|---|
1.0 | 4.0 | 1.0 | 1.0 | 3.5 |
Note:Internet Explorer 6 (and earlier versions) does not support the attribute value "transparent".
Note:Internet Explorer 7 and earlier versions do not support the value "inherit". IE8 requires !DOCTYPE. IE9 supports "inherit".
- previous page border-left
- next page border-left-style