Knowledge baseExam Center
ENEnglish
Choose language13

CKTIS / CSS

border-left-color — left border color

The border-left-color property sets the color of an element’s physical left border. It does not set its width or style; the initial value currentcolor uses the element’s text color.

Version: CSS modules; structured CSSWG indexes reconciled with pinned MDN BCD; Chromium 152 scope gate, per-example verification still required

Syntax

/* Level 3 */
border-left-color: <color>;
/* Level 4 draft extension */
border-left-color: <color> | <image-1D>;

border-left-color specifies the left border’s color. In Level 3, it accepts one <color> value. The initial value currentcolor uses the element’s color. The property is not inherited.

Color alone does not create a visible line: the border needs a style other than none or hidden and a nonzero width. transparent makes the border transparent without removing its width.

The example first sets every edge with border, then changes only the left color. Order matters: a later border, border-left, or border-color shorthand can override this color according to the cascade.

The Level 4 draft extends the syntax with <image-1D>, a one-dimensional image that produces border bands. A definition in a draft does not establish browser support. The example uses only a Level 3 color value and requires local verification.

Examples

<!doctype html>
<html lang="en">
<meta charset="utf-8">
<title>border-left-color</title>
<style>
  .box {
    border: 4px solid #808080;
    border-left-color: #0066cc;
    padding: 12px;
  }
</style>
<div class="box">CSS</div>
</html>

Result

A box containing CSS has a solid 4px blue (#0066cc) left border; the other three borders are gray (#808080).

The displayed code and declared result were verified in an isolated environment using the method recorded in the verification evidence for this exact version.

Sources