CSS border-inline Property

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

What You’ll Learn

The border-inline property is a logical shorthand for borders on the inline-start and inline-end sides of an element.

01

Logical

Follows text flow.

02

Shorthand

Width, style, color.

03

LTR / RTL

Direction-aware.

04

Two Values

Start vs end sides.

05

Longhands

width, style, color.

06

i18n Ready

Multilingual UI.

Definition and Usage

The border-inline CSS property is a shorthand that sets borders on both inline sides of an element — inline-start and inline-end. It combines border-inline-width, border-inline-style, and border-inline-color in one declaration.

Unlike border-left and border-right, which always target physical sides, border-inline adapts to writing mode and text direction. In horizontal left-to-right text, inline sides are usually left and right. In right-to-left text, the same rule still applies to the correct sides relative to the reading direction.

💡
Beginner Tip

Use border-inline when you want vertical accent borders on both sides of content that should flip correctly in Arabic, Hebrew, or other RTL languages without rewriting your CSS.

📝 Syntax

border-inline accepts border width, style, and color values like the regular border shorthand:

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

Basic Example

border-inline.css
p {
  border-inline: 2px solid blue;
}

Syntax Rules

  • One width value applies the same border width to inline-start and inline-end.
  • Two width values set inline-start first, then inline-end.
  • Style and color values apply to both inline sides unless set via longhands.
  • Omitted components use their initial values: medium, none, currentcolor.
  • The mapped physical sides change with direction and writing-mode.

⚡ Quick Reference

QuestionAnswer
Initial valuemedium none currentcolor
Applies toInline-start and inline-end border sides
InheritedNo
AnimatablePartially (color and width)
Common useQuote bars, RTL layouts, direction-aware side borders

Default Value

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

💎 Property Values

ComponentExampleMeaning
border-width2px, thin, 2px 4pxThickness on inline-start and inline-end
border-stylesolid, dashed, dottedHow the inline borders are drawn
border-colorblue, #2563ebColor of both inline borders

Common Value Types

2px solidsolid inline borders
3px dasheddashed style
2px 6px solidasymmetric widths

Inline Borders and Writing Modes

border-inline targets the sides along the inline axis. In horizontal LTR text, that is usually left and right. In RTL, the physical sides swap but the logical inline sides stay correct relative to text flow.

LTR (direction: ltr)

Inline borders follow text

RTL (direction: rtl)

Inline borders follow text

border-inline vs related properties

PropertyTargetsBest for
border-inlineInline-start and inline-end sidesDirection-aware side borders in multilingual layouts
border-left / border-rightPhysical left and right sidesSimple LTR-only layouts with fixed sides
border-blockBlock-start and block-end sidesTop and bottom borders along the block axis
borderAll four sidesFull box borders on every edge

👀 Live Preview

A paragraph with 2px solid blue inline borders:

This paragraph has inline borders on both inline sides.

Uses border-inline: 2px solid #2563eb;.

Examples Gallery

Try border-inline with equal borders, asymmetric widths, RTL text, and dashed styles.

📚 Basic Inline Borders

Apply matching borders on both inline sides.

Example 1 — 2px Solid Blue Border

Apply a solid blue border to both inline-start and inline-end, as in the reference tutorial.

border-inline-basic.html
<style>
  p {
    border-inline: 2px solid blue;
  }
</style>

<p>
  This paragraph has a 2px solid blue border on both inline sides.
</p>
Try It Yourself

How It Works

One shorthand declaration sets width, style, and color on both inline sides. In LTR horizontal text, you will usually see borders on the left and right.

Example 2 — Different Widths on Each Inline Side

Use two width values so inline-start and inline-end borders have different thickness.

border-inline-asymmetric.css
.quote {
  padding: 0.75rem 1rem;
  border-inline: 2px 6px solid #2563eb;
  background: #eff6ff;
}
Try It Yourself

How It Works

The first width (2px) applies to inline-start and the second (6px) to inline-end. This is useful for quote bars that emphasize the start side of the text.

🎨 RTL and Style Variations

See how inline borders adapt to text direction and border styles.

Example 3 — RTL Layout

The same border-inline rule works correctly when text direction is right-to-left.

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

<p class="rtl-text">
  نص تجريبي بالعحاد المنطقي
</p>
Try It Yourself

How It Works

In RTL, inline-start is on the right and inline-end is on the left. You do not need separate border-right rules — border-inline adapts automatically.

Example 4 — Dashed Inline Borders

Combine a dashed style with padding for a lightweight callout effect.

border-inline-dashed.css
.callout {
  padding: 1rem;
  border-inline: 3px dashed #7c3aed;
  background: #faf5ff;
  border-radius: 0.5rem;
}
Try It Yourself

How It Works

Any valid border style works with border-inline. Dashed borders on both inline sides create a subtle framed callout without boxing in the top and bottom.

🧠 How border-inline Works

1

Browser reads direction

Writing mode and direction define inline-start and inline-end.

Context
2

Shorthand sets inline borders

border-inline applies width, style, and color to both inline sides.

Apply
3

Physical sides are mapped

In LTR, inline sides are usually left and right. In RTL, they swap automatically.

Mapping
=

Direction-aware side borders

Your element gets inline borders that follow the text flow.

Modern Browser Support

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

Baseline · Modern browsers

Logical inline borders in today’s browsers

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

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

Conclusion

The border-inline property is a practical logical shorthand for borders along the text flow direction. It keeps your CSS maintainable in LTR and RTL layouts and avoids hard-coding left and right sides when direction may change.

Use it for quote bars, side accents, and any design where inline borders should follow the reader’s text direction.

💡 Best Practices

✅ Do

  • Use border-inline in multilingual and RTL interfaces
  • Pair with padding so content does not touch the borders
  • Prefer logical properties over border-left when direction may change
  • Test with both direction: ltr and direction: rtl
  • Use two width values to emphasize inline-start vs inline-end

❌ Don’t

  • Assume inline always means physical left and right in every writing mode
  • Mix conflicting physical and logical border rules on the same element
  • Forget that default style is none — you need a visible style and width
  • Use border-inline when you need all four sides — use border instead
  • Hard-code RTL overrides when one logical rule would suffice

Key Takeaways

Knowledge Unlocked

Five things to remember about border-inline

Use these points when styling logical inline borders.

5
Core concepts
02

Shorthand

Width style color.

Syntax
🌐03

RTL ready

Direction-aware.

Logical
📏04

Two widths

Asymmetric sides.

Values
🛠05

Not all sides

Inline only.

Scope

❓ Frequently Asked Questions

The border-inline property is a shorthand that sets borders on the inline-start and inline-end sides of an element — the sides along the text flow direction.
The initial value is medium none currentcolor, which means no visible border unless you set width, style, or color explicitly.
border-left and border-right always target physical left and right sides. border-inline follows writing direction, so the same rule works in LTR and RTL layouts.
Yes. With two width values, the first applies to inline-start and the second to inline-end, for example border-inline: 2px 4px solid blue.
Use it for multilingual sites, RTL interfaces, and any layout where borders should follow text direction instead of fixed physical sides.

Practice in the Live Editor

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