CSS border-inline-color Property

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

What You’ll Learn

The border-inline-color property sets the color of borders on the inline-start and inline-end sides of an element.

01

Logical

Follows text flow.

02

One Color

Both inline sides.

03

Two Colors

Start and end.

04

Color Formats

Hex, rgb, hsl.

05

Longhand

Part of border-inline.

06

RTL Ready

Direction-aware.

Definition and Usage

The border-inline-color CSS property sets the color of borders along the inline axis — on inline-start and inline-end. It is a longhand of the border-inline shorthand and works with logical properties that adapt to writing mode and text direction.

Unlike border-left-color and border-right-color, which always target physical sides, border-inline-color keeps your color rules correct in both LTR and RTL layouts. You can set one color for both inline sides or two colors for start and end.

💡
Beginner Tip

border-inline-color only sets color. Pair it with border-inline-width and border-inline-style, or use the border-inline shorthand first and override the color separately.

📝 Syntax

border-inline-color accepts one or two color values:

syntax.css
/* one color for both inline sides */
selector {
  border-inline-color: color;
}

/* start color and end color */
selector {
  border-inline-color: start-color end-color;
}

Basic Example

border-inline-color.css
div {
  border-inline-width: 4px;
  border-inline-style: solid;
  border-inline-color: green blue;
}

Syntax Rules

  • One color applies to both inline-start and inline-end.
  • Two colors set inline-start first, then inline-end.
  • Any valid CSS color value works: named colors, hex, rgb, hsl, currentcolor, transparent.
  • You need a visible border width and style for the color to appear.
  • The mapped physical sides change with direction and writing-mode.

⚡ Quick Reference

QuestionAnswer
Initial valuecurrentcolor
Applies toInline-start and inline-end border colors
InheritedNo
AnimatableYes, as a color
Common useDirection-aware accent borders, start/end color cues

Default Value

The default value of border-inline-color is currentcolor. That means inline borders use the element’s text color unless you set a different color explicitly.

💎 Property Values

ValueExampleMeaning
Named colorborder-inline-color: green blue;Uses CSS color keywords on start and end sides
Hexborder-inline-color: #059669 #2563eb;Hexadecimal color values for each inline side
RGB / HSLborder-inline-color: rgb(37, 99, 235) rgb(239, 68, 68);Functional color notation for precise control
currentcolorborder-inline-color: currentcolor;Matches the element’s text color
transparentborder-inline-color: transparent;Makes the inline borders fully transparent
named
hex
rgb

Common Value Types

#2563ebone color
green bluestart and end
currentcolormatches text

Inline Border Colors and Writing Modes

With border-inline-color: green blue, green always applies to inline-start and blue to inline-end — regardless of whether inline-start is on the left or right.

LTR (direction: ltr)

Green start, blue end

RTL (direction: rtl)

Green start, blue end

border-inline-color vs related properties

PropertyTargetsBest for
border-inline-colorColor on inline-start and inline-endDirection-aware side border colors
border-inlineWidth, style, and color togetherSetting full inline borders in one rule
border-left-color / border-right-colorPhysical left and right colorsFixed LTR-only layouts
border-colorAll four physical sidesFull box border coloring

👀 Live Preview

A box with green on inline-start and blue on inline-end:

Green start border, blue end border.

Uses border-inline-color: #059669 #2563eb; with a 4px solid inline border.

Examples Gallery

Try border-inline-color with start/end colors, a single color, currentcolor, and RTL text.

📚 Start and End Colors

Set different colors on inline-start and inline-end.

Example 1 — Green Start, Blue End

Set green on inline-start and blue on inline-end, matching the reference tutorial.

border-inline-color-dual.html
<style>
  div {
    border-inline-width: 4px;
    border-inline-style: solid;
    border-inline-color: green blue;
    padding: 0.75rem 1rem;
  }
</style>

<div>
  Green border on start, blue border on end.
</div>
Try It Yourself

How It Works

The first color (green) applies to inline-start and the second (blue) to inline-end. In LTR horizontal text, you usually see green on the left and blue on the right.

Example 2 — One Color on Both Sides

Use a single color value to style both inline borders the same way.

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

How It Works

One color value applies to both inline-start and inline-end. This is the simplest way to add matching accent borders on both sides.

🎨 currentcolor and RTL

Match text color or test colors in right-to-left layouts.

Example 3 — currentcolor Keyword

Let inline border colors automatically match the element’s text color.

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

How It Works

currentcolor is the default value. Explicitly using it keeps borders in sync when you change the text color on hover or in themes.

Example 4 — RTL with Start and End Colors

The same start/end color rule stays logical in right-to-left text.

border-inline-color-rtl.html
<style>
  .rtl-box {
    direction: rtl;
    border-inline: 4px solid;
    border-inline-color: #059669 #2563eb;
    padding: 0.75rem 1rem;
    background: #ecfdf5;
  }
</style>

<div class="rtl-box">
  نراس الحدود المنطقية
</div>
Try It Yourself

How It Works

Green still applies to inline-start and blue to inline-end. In RTL, inline-start is on the right, so the colors swap physically but stay correct logically.

🧠 How border-inline-color Works

1

Inline borders exist

Width and style must be set so inline borders can be painted.

Setup
2

Colors are assigned

border-inline-color sets start and/or end border colors.

Color
3

Direction maps the sides

Inline-start and inline-end map to the correct physical sides for LTR or RTL.

Mapping
=

Colored inline borders

Your element shows direction-aware colored borders on both inline sides.

Modern Browser Support

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

Baseline · Modern browsers

Logical inline border colors in today’s browsers

Chrome, Edge, Firefox, Safari, and Opera support border-inline-color in LTR and RTL layouts.

94% 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-inline-color property 94% supported

Bottom line: Use border-inline-color for direction-aware side border colors in modern multilingual projects.

Conclusion

The border-inline-color property gives you precise, direction-aware control over inline border colors. Use one color for both sides or two colors to distinguish inline-start from inline-end in multilingual layouts.

Pair it with inline border width and style, and prefer logical colors over physical left/right rules when text direction may change.

💡 Best Practices

✅ Do

  • Set border-inline-width and border-inline-style before expecting colors to show
  • Use two colors to visually distinguish inline-start from inline-end
  • Prefer logical colors in RTL and multilingual interfaces
  • Use currentcolor to keep borders synced with text color
  • Test color combinations in both LTR and RTL

❌ Don’t

  • Assume inline-start is always the physical left side
  • Set color alone without a visible border width and style
  • Mix conflicting physical and logical border color rules
  • Use low-contrast start/end colors that hurt readability
  • Hard-code RTL color overrides when one logical rule suffices

Key Takeaways

Knowledge Unlocked

Five things to remember about border-inline-color

Use these points when coloring logical inline borders.

5
Core concepts
02

currentcolor

Default value.

Default
🔴03

Two values

Start vs end.

Syntax
🌐04

RTL ready

Direction-aware.

Logical
🛠05

Needs width

Color only.

Usage

❓ Frequently Asked Questions

The border-inline-color property sets the color of borders on the inline-start and inline-end sides of an element — the sides along the text flow direction.
The initial value is currentcolor, which uses the element's text color for the inline borders.
Yes. With two values, the first color applies to inline-start and the second to inline-end, for example border-inline-color: green blue.
border-inline-color only sets color. You also need a visible border-inline-style such as solid and a border-inline-width greater than zero.
border-left-color always targets the physical left side. border-inline-color follows writing direction, so the same rule works in LTR and RTL layouts.

Practice in the Live Editor

Open the HTML editor, try border-inline-color, and preview direction-aware 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