CSS border-inline-end-color Property

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

What You’ll Learn

The border-inline-end-color property sets the color of the border on the inline-end side only.

01

Inline-End

Trailing side color.

02

Longhand

Color only.

03

LTR / RTL

Direction-aware.

04

Color Formats

Hex, rgb, hsl.

05

currentcolor

Matches text.

06

Logical

Not right-color.

Definition and Usage

The border-inline-end-color CSS property sets the color of the border on the inline-end side of an element. It is a longhand of border-inline-end and part of CSS logical properties that adapt to writing mode and text direction.

Unlike border-right-color, which always targets the physical right side, border-inline-end-color follows the text flow. In LTR horizontal text, inline-end is usually the right side; in RTL, it is usually the left.

💡
Beginner Tip

border-inline-end-color only sets color. Pair it with a border width and style — for example border: 2px solid; — so the inline-end border is visible.

📝 Syntax

border-inline-end-color accepts any valid CSS color value:

syntax.css
selector {
  border-inline-end-color: color;
}

Basic Example

border-inline-end-color.css
.box {
  border: 2px solid;
  border-inline-end-color: red;
}

Syntax Rules

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

⚡ Quick Reference

QuestionAnswer
Initial valuecurrentcolor
Applies toInline-end border color only
InheritedNo
AnimatableYes, as a color
Common useTrailing edge accents, RTL-safe end borders

Default Value

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

💎 Property Values

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

Common Value Types

rednamed color
#2563ebhex value
currentcolormatches text

Inline-End Color and Writing Modes

border-inline-end-color always targets the end of the inline axis. The physical side changes with text direction, but the logical meaning stays the same.

LTR (direction: ltr)

Red inline-end (usually right)

RTL (direction: rtl)

Red inline-end (usually left)

border-inline-end-color vs related properties

PropertyTargetsBest for
border-inline-end-colorColor on inline-end onlyTrailing edge accent color in logical layouts
border-inline-endWidth, style, and color on inline-endSetting the full inline-end border in one rule
border-inline-colorColors on both inline sidesStart and end colors together
border-right-colorPhysical right side colorFixed LTR-only layouts

👀 Live Preview

A box with a red inline-end border on a gray frame:

Red border on the inline-end side.

Uses border: 3px solid #cbd5e1; and border-inline-end-color: #dc2626;.

Examples Gallery

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

📚 Basic End Border Colors

Color only the trailing inline border side.

Example 1 — Red Inline-End Border

Set the inline-end border color to red, matching the reference tutorial.

border-inline-end-color-red.html
<style>
  .box {
    border: 2px solid;
    border-inline-end-color: red;
    padding: 0.75rem 1rem;
  }
</style>

<div class="box">
  This box has an inline-end border color of red.
</div>
Try It Yourself

How It Works

border: 2px solid gives all sides a visible border. border-inline-end-color: red overrides only the trailing inline side. In LTR, that is usually the right edge.

Example 2 — Hex Color on Inline-End

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

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

How It Works

All sides start with gray from the shorthand, then border-inline-end-color recolors only the trailing inline edge to blue.

🎨 currentcolor and RTL

Match text color or test end border color in RTL.

Example 3 — currentcolor Keyword

Make the inline-end border match the element’s text color.

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

How It Works

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

Example 4 — RTL Layout

The same inline-end color rule adapts when text direction is right-to-left.

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

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

How It Works

Green still applies to inline-end. In RTL, inline-end is on the left, so you do not need a separate border-left-color rule.

🧠 How border-inline-end-color Works

1

Border exists on inline-end

A width and style must be set so the inline-end border can be painted.

Setup
2

Color is applied

border-inline-end-color sets the trailing inline border color.

Color
3

Direction maps the side

Inline-end maps to the correct physical side for LTR or RTL.

Mapping
=

Colored end border

Only the trailing inline edge shows your chosen color.

Modern Browser Support

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

Baseline · Modern browsers

Logical inline-end colors in today’s browsers

Chrome, Edge, Firefox, Safari, and Opera support border-inline-end-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-end-color property 94% supported

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

Conclusion

The border-inline-end-color property gives you precise control over the color of the trailing inline border. Use it when only the end edge needs a different color in LTR or RTL layouts.

Pair it with border width and style, and prefer this logical longhand over border-right-color when text direction may change.

💡 Best Practices

✅ Do

  • Set border width and style before expecting color to show
  • Use border-inline-end-color for trailing edge accents in RTL layouts
  • Prefer logical colors over border-right-color when direction may change
  • Use currentcolor to sync the end border with text color
  • Test end border colors in both LTR and RTL

❌ Don’t

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

Key Takeaways

Knowledge Unlocked

Five things to remember about border-inline-end-color

Use these points when coloring the trailing inline border.

5
Core concepts
02

currentcolor

Default value.

Default
🔴03

Any CSS color

Hex, rgb, hsl.

Values
🌐04

RTL ready

Direction-aware.

Logical
🛠05

Needs width

Color longhand.

Usage

❓ Frequently Asked Questions

The border-inline-end-color property sets the color of the border on the inline-end side only — the trailing edge along the text flow direction.
The initial value is currentcolor, which uses the element's text color for the inline-end border.
In horizontal left-to-right text, inline-end is usually the right side. In RTL, inline-end is usually the left side.
border-inline-end-color only sets color. You also need a visible border width and style on that side, or use a shorthand like border: 2px solid.
border-right-color always targets the physical right side. border-inline-end-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-end-color, and preview direction-aware end 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