CSS border-inline Property

Beginner
6 min read
Updated: Oct 2026
3 examples
Live preview

Definition and Usage

The border-inline property is a logical shorthand that sets border-inline-width, border-inline-style, and border-inline-color on both the inline-start and inline-end sides at once.

In the default horizontal writing mode, that means left and right. Change writing-mode or direction, and the same rule maps to different physical edges. For the other axis, use border-block.

Baseline · Widely available.

Not deprecated and not experimental. Logical border shorthands have been widely available across browsers since April 2021. Internet Explorer does not support them.

CSS Syntax

syntax.css
border-inline: <line-width> || <line-style> || <color> | initial | inherit;

Same value shape as border, but only for the inline axis. One declaration styles both inline sides the same way.

Property Values

ValueDescriptionTry it
<line-width>Thickness on both inline sides. Default mediumTry it
solidContinuous line on inline-start and inline-endTry it
dashedDashed line on both inline sidesTry it
dottedDotted line on both inline sidesTry it
With writing-modePhysical edges change when the writing mode is verticalTry it
noneNo inline border. Initial styleTry it
<color>Color for both inline sides. Default currentColorTry it
initialResets to the initial values (style none)Try it
inheritInherits this property from the parent elementTry it

How to Use border-inline

Think in inline start and end, not only left and right.

  1. Decide you want matching borders on the inline axis (usually left and right in English layouts).
  2. Set a style such as solid or dashed. Without a style, nothing draws.
  3. Add width and color as needed: border-inline: 4px solid #2563eb;.
  4. If start and end must differ, switch to border-inline-start and border-inline-end.
PieceRequired?Role
StyleYes (to show a line)Initial style is none
Width and colorOptionalDefaults: medium and currentColor
Same on both inline sidesBy designOne value styles start and end together
writing-mode / directionOptionalChanges which physical edges receive the border

Live Preview

Change border-inline and the writing mode. Watch which physical edges pick up the border.

In horizontal-tb, inline sides are left and right. In vertical-rl, they become the top and bottom edges.

Box

border-inline: 4px solid #2563eb · writing-mode: horizontal-tb

CSS Examples

Each snippet focuses on border-inline. Use Try It Yourself for a live editor.

Example 1 — Solid Inline Borders

In horizontal text, this draws matching left and right borders.

CSS
<style>
  div {
    border-inline: 4px solid #2563eb;
    padding: 12px;
  }
</style>

<div>Left and right borders</div>
Try It Yourself

How It Works

  1. Target the box. The rule applies to the div.
  2. Set a visible style. solid is required so a line appears.
  3. Set width and color. 4px and blue apply to both inline sides.
  4. Map to physical edges. With default horizontal-tb, inline-start is left and inline-end is right. The top and bottom sides stay without a border.

Example 2 — Dashed Inline Borders

Same shorthand shape, different style keyword.

CSS
<style>
  div {
    border-inline: 3px dashed #dc2626;
    padding: 12px;
  }
</style>

<div>Dashed inline sides</div>
Try It Yourself

How It Works

  1. Keep the same shorthand shape. Width, style, and color still share one property.
  2. Swap the style. dashed replaces the solid line with short gaps.
  3. Color both sides. Red applies to inline-start and inline-end together.
  4. Still logical. In RTL, those sides flip with the text direction, unlike fixed border-left.

Example 3 — Vertical Writing Mode

The same rule paints top and bottom when text flows vertically.

CSS
<style>
  div {
    writing-mode: vertical-rl;
    border-inline: 4px solid #0f766e;
    padding: 12px;
  }
</style>

<div>Vertical text</div>
Try It Yourself

How It Works

  1. Switch the writing mode. vertical-rl makes lines run top to bottom.
  2. Keep the same border rule. border-inline still targets the inline axis.
  3. Physical edges change. Inline sides now map to top and bottom instead of left and right.
  4. Why logical helps. One rule stays correct across writing modes; border-left would not.

Edge Cases & Pitfalls

If the border is missing or on the wrong sides, check these first.

style

No style means no border

border-inline: 4px #000 still looks empty because style defaults to none. Always include solid or another style keyword.

same

Both inline sides match

This shorthand cannot style start and end differently. Use border-inline-start and border-inline-end for that.

axis

Only the inline axis

border-inline never paints the block edges. Pair it with border-block, or use border for all four sides.

physical

Not a drop-in for left/right forever

In horizontal LTR it looks like left and right. In RTL or vertical modes, the physical edges change. That is the point of logical properties.

ie

No Internet Explorer support

IE 11 does not implement border-inline. Use physical border-left / border-right only if you must support IE.

Browser Support

border-inline is a browser CSS property for logical borders. Node.js, Deno, and Bun do not apply it.

✓ Baseline · Widely available

border-inline

Chrome 87+, Firefox 66+, Safari 14.1+, Edge 87+. Available across browsers since April 2021. Not supported in Internet Explorer.

97% Global support
Google Chrome 87+
Full support
Mozilla Firefox 66+
Full support
Apple Safari 14.1+
Full support
Microsoft Edge 87+
Full support
Opera 73+
Full support
Samsung Internet 14.0+
Full support
Internet Explorer No support
None
border-inline Widely supported

Bottom line: Safe for modern sites and multilingual layouts. Prefer logical borders when writing mode or direction can change. It is not a runtime API.

Key Takeaways

  • Role: one shorthand for width, style, and color on both inline sides.
  • Style first: without a visible style, width and color do nothing.
  • Logical: maps to left/right or top/bottom based on writing mode.
  • Style required. Not inherited. Pair with border-block for the other axis.

One line: border-inline: 4px solid black; draws matching borders on the inline axis — after you include a style.

Frequently Asked Questions

It is a logical shorthand that sets border-inline-width, border-inline-style, and border-inline-color on both the inline-start and inline-end sides at once.
A border needs a visible style. The initial style is none, so width or color alone will not draw a line. Use solid, dashed, dotted, or another style.
border-left and border-right always target physical left and right. border-inline follows writing-mode and direction, so the same rule works in LTR, RTL, and vertical layouts.
Yes. One declaration styles inline-start and inline-end together. For different sides, use border-inline-start and border-inline-end.
Use border-block for the block-start and block-end sides. Together, border-block and border-inline cover all four logical edges.
It is Baseline Widely available since April 2021: Chrome 87+, Firefox 66+, Safari 14.1+, and Edge 87+. Internet Explorer does not support it. It is a browser CSS property, not a Node.js feature.

Next: border-inline-color

Set the color of both inline borders without changing width or style.

border-inline-color tutorial →

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.

8 people found this page helpful