CSS border-left Property

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

What You’ll Learn

The border-left property sets the width, style, and color of the physical left border in one shorthand rule.

01

Left Side

Physical edge.

02

Shorthand

Width, style, color.

03

solid

Common style.

04

Quote Bars

Accent borders.

05

Longhands

width, style, color.

06

Classic CSS

Universal support.

Definition and Usage

The border-left CSS property is a physical shorthand that sets the border on the left side of an element. It combines border-left-width, border-left-style, and border-left-color in one declaration.

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

💡
Beginner Tip

For multilingual layouts that must adapt to RTL, consider border-inline-start instead of border-left so the accent bar follows the reading direction.

📝 Syntax

border-left accepts border width, style, and color like other border shorthands:

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

Basic Example

border-left.css
.box {
  border-left: 5px solid red;
}

Syntax Rules

  • Sets width, style, and color for the left border side only.
  • Omitted components use initial values: medium, none, currentcolor.
  • Any valid border width, style, and color values are accepted.
  • Always affects the physical left side, regardless of direction or writing-mode.
  • Use longhands when you need to set only width, style, or color on the left side.

⚡ Quick Reference

QuestionAnswer
Initial valuemedium none currentcolor
Applies toLeft border side only
InheritedNo
AnimatablePartially (color and width)
Common useQuote bars, left dividers, sidebar accents

Default Value

The default value of border-left is medium none currentcolor. No visible border appears until you set a non-none style and a width greater than zero.

💎 Property Values

ComponentExampleMeaning
border-width4px, thin, 0.25remThickness of the left border
border-stylesolid, dashed, dottedHow the left border is drawn
border-colorred, #2563eb, currentcolorColor of the left border

Common Value Types

4px solidsolid left border
3px dasheddashed style
6px solidthick accent

Left Border and Text Direction

border-left always draws on the physical left side. Text direction does not move the border — compare with logical properties when building RTL layouts.

LTR (direction: ltr)

Left border on the left side

RTL (direction: rtl)

Left border still on the left side

border-left vs related properties

PropertyTargetsBest for
border-leftPhysical left side onlyLeft accent bars and LTR quote dividers
border-inline-startLogical inline-start sideDirection-aware leading borders in RTL layouts
border-rightPhysical right side onlyRight accent bars and trailing dividers
borderAll four sidesFull box outlines

👀 Live Preview

A box with a blue border on the left side:

Blue border on the left side.

Uses border-left: 4px solid #2563eb;.

Examples Gallery

Try border-left with solid red borders, quote accents, RTL comparison, and dashed styles.

📚 Basic Left Borders

Add a border on the physical left side of an element.

Example 1 — 5px Solid Red Border

Add a solid red left border on a box, matching the reference tutorial.

border-left-basic.html
<style>
  .box {
    border-left: 5px solid red;
    padding: 10px;
  }
</style>

<div class="box">
  This box has a 5px solid red left border.
</div>
Try It Yourself

How It Works

The shorthand sets width, style, and color on the left side only. Other sides keep their default borders unless you set them separately.

Example 2 — Quote Accent Bar

Use a left border as a vertical accent bar on blockquotes or callouts.

border-left-quote.css
blockquote {
  margin: 0;
  padding: 0.75rem 1rem;
  border-left: 4px solid #2563eb;
  background: #eff6ff;
  color: #334155;
}
Try It Yourself

How It Works

A left-side border creates a vertical accent at the physical left edge. Pair it with padding so text does not touch the border line.

🎨 RTL and Style Variations

See how border-left behaves in RTL and with different styles.

Example 3 — border-left in RTL

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

border-left-rtl.html
<style>
  .rtl-box {
    direction: rtl;
    padding: 0.75rem 1rem;
    border-left: 4px solid #059669;
    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 instead.

Example 4 — Dashed Left Border

Use a dashed style for a lighter left-edge accent.

border-left-dashed.css
.note {
  padding: 0.75rem 1rem;
  border-left: 3px dashed #7c3aed;
  background: #faf5ff;
}
Try It Yourself

How It Works

Any valid border style works on the left side. A dashed left border adds visual emphasis without a full box outline.

🧠 How border-left Works

1

You set width, style, and color

The shorthand combines all three border components for the left side in one rule.

Shorthand
2

Browser draws the left edge

border-left applies only to the physical left side of the element box.

Apply
3

Other sides stay unchanged

Top, right, and bottom borders keep their own values unless you set them separately.

Scope
=

Left border applied

Your element shows a styled border on the physical left edge.

Modern Browser Support

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

Baseline · Modern browsers

Physical left borders in every browser

Chrome, Edge, Firefox, Safari, and Opera have supported border-left 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 property 99% supported

Bottom line: border-left is one of the most reliable CSS border properties across all browsers.

Conclusion

The border-left property controls the border on the physical left edge. Use it for quote bars, left dividers, and accent borders in classic LTR layouts.

Combine width, style, and color in one shorthand, or use border-left-width, border-left-style, and border-left-color when you need finer control.

💡 Best Practices

✅ Do

  • Use left borders for quote bars and callout accents in LTR layouts
  • Pair with padding so text does not touch the border
  • Use border-inline-start instead when RTL support is required
  • Combine width, style, and color in one shorthand when all three are needed
  • Use longhands when only one component needs to change

❌ Don’t

  • Expect border-left to move to the right in RTL text
  • Mix conflicting physical and logical border rules on the same element
  • Use border-left for leading accents in multilingual RTL layouts
  • Forget a visible style — width alone may not show a border
  • Hard-code left borders when a logical property would be clearer

Key Takeaways

Knowledge Unlocked

Five things to remember about border-left

Use these points when styling physical left borders.

5
Core concepts
02

Default none

No border.

Default
🔀03

5px solid

Common pattern.

Values
🌐04

Fixed left

Not logical.

Physical
🛠05

Quote bars

Real use case.

Usage

❓ Frequently Asked Questions

The border-left property is a shorthand that sets the width, style, and color of the physical left border of an element in one declaration.
The initial value is medium none currentcolor, which means no visible border unless you set width, style, or color explicitly.
border-left always targets the physical left side of an element, regardless of text direction or writing mode.
border-left is fixed to the physical left side. border-inline-start follows writing direction, so it moves to the right in RTL layouts.
Use it for quote accent bars, sidebar dividers, and left-edge highlights in LTR layouts where the border should stay on the left side.

Practice in the Live Editor

Open the HTML editor, try border-left, and preview left border styles 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