CSS border-left-color Property

Beginner
⏱️ 7 min read
📚 Updated: Jul 2026
🎯 4 Examples
Box Model & Layout

What You’ll Learn

The border-left-color property sets the color of the border on the physical left side only.

01

Left Side

Physical color.

02

Longhand

Color only.

03

Color Formats

Hex, rgb, hsl.

04

currentcolor

Matches text.

05

Override

Recolor left only.

06

Classic CSS

Universal support.

Definition and Usage

The border-left-color CSS property sets the color of the border on the physical left side of an element. It is a longhand of border-left and works alongside border-left-width and border-left-style.

Unlike logical properties such as border-inline-start-color, border-left-color always targets the physical left edge — even in RTL text. That makes it straightforward for classic LTR layouts and left accent dividers.

💡
Beginner Tip

border-left-color only sets color. Pair it with a visible border width and style, or use border: 5px solid black; plus this longhand to recolor only the left side.

📝 Syntax

border-left-color accepts any valid CSS color value:

syntax.css
selector {
  border-left-color: color;
}

Basic Example

border-left-color.css
div {
  border: 5px solid black;
  border-left-color: red;
}

Syntax Rules

  • Accepts named colors, hex, rgb, hsl, currentcolor, and transparent.
  • Only affects the left border side; other sides keep their own colors.
  • You need a visible border width and style for the color to appear.
  • Always affects the physical left side, regardless of direction or writing-mode.
  • Default is currentcolor, matching the element’s text color.

⚡ Quick Reference

QuestionAnswer
Initial valuecurrentcolor
Applies toLeft border color only
InheritedNo
AnimatableYes, as a color
Common useQuote bar accents, left edge highlights, recoloring one side

Default Value

The default value of border-left-color is currentcolor. The left border uses the element’s text color unless you set a different color explicitly.

💎 Property Values

ValueExampleMeaning
Named colorborder-left-color: green;Uses a CSS color keyword on the left side
Hexborder-left-color: #2563eb;Hexadecimal color on the physical left side
HSLborder-left-color: hsl(142, 71%, 45%);HSL functional notation
currentcolorborder-left-color: currentcolor;Matches the element’s text color
transparentborder-left-color: transparent;Makes the left border invisible
green
#2563eb
hsl

Common Value Types

greennamed color
#2563ebhex value
currentcolormatches text

Left Border Color and Text Direction

border-left-color always colors the physical left side. Text direction does not move the border — compare with border-inline-start-color when building RTL layouts.

LTR (direction: ltr)

Red left border on the left side

RTL (direction: rtl)

Left border color still on the left side

border-left-color vs related properties

PropertyTargetsBest for
border-left-colorColor on the physical left side onlyLeft accent bars, quote dividers, recoloring one side
border-leftWidth, style, and color on the left sideSetting the full left border in one rule
border-inline-start-colorColor on the inline-start side (direction-aware)Leading edge accents that follow text direction in RTL
border-left-styleStyle on the physical left side onlyChanging solid, dashed, or dotted on the left edge

👀 Live Preview

A box with a blue left border on a gray frame:

Blue border on the physical left side.

Uses border: 3px solid #cbd5e1; and border-left-color: #2563eb;.

Examples Gallery

Try border-left-color with named colors, hex values, currentcolor, and RTL text.

📚 Basic Left Border Colors

Color only the physical left border side.

Example 1 — Red Left Border Color

Change the left border color to red on a box with a black frame, matching the reference tutorial.

border-left-color-red.html
<style>
  div {
    border: 5px solid black;
    border-left-color: red;
    padding: 10px;
  }
</style>

<div>
  This is a div with a red left border.
</div>
Try It Yourself

How It Works

The shorthand sets a black border on all sides. border-left-color: red overrides only the left side color, leaving top, right, and bottom black.

Example 2 — Hex Color on the Left Side

Use a hex color for the left border while keeping other sides neutral gray.

border-left-color-hex.css
.card {
  border: 3px solid #cbd5e1;
  border-left-color: #2563eb;
  padding: 1rem;
  background: #eff6ff;
}
Try It Yourself

How It Works

All sides start with gray from the shorthand, then border-left-color recolors only the physical left edge to blue.

🎨 currentcolor and RTL

Match text color or see how left border color behaves in RTL.

Example 3 — currentcolor Keyword

Make the left border match the element’s text color.

border-left-color-current.css
.quote {
  color: #7c3aed;
  border: 3px solid #cbd5e1;
  border-left-color: currentcolor;
  padding: 0.75rem 1rem;
}
Try It Yourself

How It Works

currentcolor is the default value. Here it makes the left border purple to match the text while other sides stay gray.

Example 4 — border-left-color in RTL

In RTL text, border-left-color stays on the physical left — unlike border-inline-start-color.

border-left-color-rtl.html
<style>
  .rtl-box {
    direction: rtl;
    border: 3px solid #cbd5e1;
    border-left-color: #059669;
    padding: 0.75rem 1rem;
    background: #ecfdf5;
  }
</style>

<div class="rtl-box">
  حد فيزيكي على اليسار
</div>
Try It Yourself

How It Works

RTL changes text flow but not the physical left edge. For a leading accent in RTL, use border-inline-start-color instead.

🧠 How border-left-color Works

1

Border must be visible

A width and style on the left side create a border to color.

Setup
2

Color longhand applies

border-left-color sets the physical left edge color only.

Color
3

Other sides stay unchanged

Top, right, and bottom borders keep their own colors unless you override them.

Scope
=

Colored left border

Only the physical left edge shows your chosen color.

Modern Browser Support

The border-left-color property is supported in all modern browsers, including Chrome, Firefox, Safari, Edge, and Opera.

Baseline · Modern browsers

Physical left border colors in every browser

Chrome, Edge, Firefox, Safari, and Opera have supported border-left-color since the earliest CSS versions.

99% Modern browser support
Google Chrome87+ · Desktop & Mobile
Full support
Mozilla Firefox66+ · Desktop & Mobile
Full support
Apple Safari14.1+ · macOS & iOS
Full support
Microsoft Edge87+ · All versions
Full support
Opera73+ · Modern versions
Full support
border-left-color property 99% supported

Bottom line: Use border-left-color for reliable left-side accent colors in any modern browser.

Conclusion

The border-left-color property controls the color of the physical left border. Use it for quote bars, left accents, and highlights where the border should stay on the left side.

Pair it with border-left-width and border-left-style, or use the border-left shorthand when you want width, style, and color together.

💡 Best Practices

✅ Do

  • Set border width and style alongside color for visible left borders
  • Use currentcolor when the left border should match text
  • Use border-left-color for classic LTR left accent dividers
  • Override one side after a border shorthand to recolor only the left
  • Use border-inline-start-color when the accent must follow text direction in RTL

❌ Don’t

  • Set color alone without a visible border width and style
  • Expect border-left-color to move to the right in RTL layouts
  • Mix conflicting physical and logical color rules on the same element
  • Use border-left-color when the design needs a leading edge in RTL
  • Forget that the shorthand sets all sides before your longhand override

Key Takeaways

Knowledge Unlocked

Five things to remember about border-left-color

Use these points when coloring physical left borders.

5
Core concepts
02

currentcolor

Default.

Default
🔀03

red

Named color.

Values
🌐04

Fixed left

Not RTL-aware.

Physical
🛠05

Needs width

Color longhand.

Usage

❓ Frequently Asked Questions

The border-left-color property sets the color of the border on the physical left side of an element only.
The initial value is currentcolor, which uses the element's text color for the left border.
border-left-color always targets the physical left side, regardless of text direction or writing mode.
border-left-color only sets color. You also need a visible border width and style on the left side, or use a shorthand like border: 5px solid black plus this longhand.
border-left-color is fixed to the physical left side. border-inline-start-color follows writing direction, so it moves to the right in RTL layouts.

Practice in the Live Editor

Open the HTML editor, try border-left-color, and preview left-side border colors instantly.

HTML Editor →

About the author

Mari Selvan M P
Mari Selvan M P 🔗

Developer, cloud engineer, and technical writer

  • Experience 12 years building web and cloud systems
  • Focus Full Stack Development, AWS, and Developer Education

I write practical tutorials so students and working developers can learn by doing—from databases and APIs to deployment on AWS.

5 people found this page helpful