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.
Fundamentals
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.
Foundation
📝 Syntax
border-inline accepts border width, style, and color values like the regular border shorthand:
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.
Cheat Sheet
⚡ Quick Reference
Question
Answer
Initial value
medium none currentcolor
Applies to
Inline-start and inline-end border sides
Inherited
No
Animatable
Partially (color and width)
Common use
Quote bars, RTL layouts, direction-aware side borders
Defaults
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.
Reference
💎 Property Values
Component
Example
Meaning
border-width
2px, thin, 2px 4px
Thickness on inline-start and inline-end
border-style
solid, dashed, dotted
How the inline borders are drawn
border-color
blue, #2563eb
Color of both inline borders
Common Value Types
2px solidsolid inline borders
3px dasheddashed style
2px 6px solidasymmetric widths
Scope
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
inline-startblock-startblock-endinline-end
RTL (direction: rtl)
Inline borders follow text
block-startinline-startinline-endblock-end
Compare
border-inline vs related properties
Property
Targets
Best for
border-inline
Inline-start and inline-end sides
Direction-aware side borders in multilingual layouts
border-left / border-right
Physical left and right sides
Simple LTR-only layouts with fixed sides
border-block
Block-start and block-end sides
Top and bottom borders along the block axis
border
All four sides
Full box borders on every edge
Preview
👀 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;.
Hands-On
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>
This paragraph has a 2px solid blue border on both inline sides.
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.
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><pclass="rtl-text">
نص تجريبي بالعحاد المنطقي
</p>
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.
Compatibility
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 property94% supported
Bottom line: Use border-inline for direction-aware side borders in modern multilingual projects.
Wrap Up
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.
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
Summary
Key Takeaways
Knowledge Unlocked
Five things to remember about border-inline
Use these points when styling logical inline borders.
5
Core concepts
↔️01
Inline sides
Start and end.
Purpose
⚡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.