CSS border-inline-width Property

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

What You’ll Learn

The border-inline-width property sets how thick the border is on both inline sides — inline-start and inline-end.

01

Both Inline

Start and end width.

02

thin

About 1px.

03

medium

Default ~3px.

04

thick

About 5px.

05

Length

px, em, rem.

06

RTL Ready

Direction-aware.

Definition and Usage

The border-inline-width CSS property controls the thickness of the border on both inline edges of an element. It is a longhand of border-inline and accepts the same width values as standard border width properties.

Unlike border-width, which sets thickness on all four sides, border-inline-width only affects the two inline edges and adapts to writing mode and text direction — useful for RTL layouts and multilingual interfaces.

💡
Beginner Tip

border-inline-width only sets thickness. Pair it with border-inline-style and border-inline-color, or use the border-inline shorthand. You can pass one value for both edges or two values for start and end separately.

📝 Syntax

border-inline-width accepts keyword or length values — one value for both edges, or two for start and end:

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

Basic Example

border-inline-width.css
.box {
  border-inline-width: 5px;
  border-inline-style: solid;
  border-inline-color: black;
}

Syntax Rules

  • Accepts thin, medium, thick, or any length such as 2px or 0.25em.
  • One value sets the same width on both inline edges; two values set start then end.
  • Only affects the two inline border edges; block sides keep their own widths.
  • A visible border-inline-style is required for the width to show.
  • In horizontal writing modes, inline edges are usually the left and right sides.
  • Default is medium, typically about 3px in most browsers.

⚡ Quick Reference

QuestionAnswer
Initial valuemedium
Applies toBoth inline edges (start and end)
InheritedNo
AnimatableYes (as length)
Common useColumn dividers, paired inline accents, RTL-safe layouts

Default Value

The default value of border-inline-width is medium, which browsers typically render as about 3px when a visible border style is applied.

💎 Property Values

ValueExampleMeaning
thinborder-inline-width: thin;Thin border, typically about 1px
mediumborder-inline-width: medium;Default thickness, typically about 3px
thickborder-inline-width: thick;Thick border, typically about 5px
Lengthborder-inline-width: 2px;Exact size in px, em, rem, etc.
initialborder-inline-width: initial;Resets to the default medium value
inheritborder-inline-width: inherit;Inherits from the parent element

Keyword Width Comparison

thin~1px
medium~3px default
thick~5px

Inline Width and Writing Modes

border-inline-width applies to both inline-start and inline-end. In horizontal writing modes, that usually means the left and right sides — regardless of text direction.

LTR (direction: ltr)

5px left and right inline edges

RTL (direction: rtl)

5px left and right inline edges

border-inline-width vs related properties

PropertyTargetsBest for
border-inline-widthThickness on both inline edgesMatching or asymmetric inline border sizes
border-inline-start-widthThickness on inline-start onlyLeading-edge accent bars in logical layouts
border-inline-end-widthThickness on inline-end onlyTrailing-edge dividers in logical layouts
border-inlineWidth, style, and color on both inline edgesSetting the full inline border in one rule
border-widthThickness on all four sidesUniform frames around an element

👀 Live Preview

A box with 4px blue borders on both inline edges:

4px borders on the inline edges.

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

Examples Gallery

Try border-inline-width with pixel values, keywords, asymmetric widths, and RTL layouts.

📚 Basic Inline Border Widths

Control thickness on both inline-start and inline-end.

Example 1 — 5px Inline Border

Set a 5px width on both inline edges with style and color longhands, matching the reference tutorial.

border-inline-width-5px.html
<style>
  .box {
    border-inline-width: 5px;
    border-inline-style: solid;
    border-inline-color: black;
    padding: 0.75rem 1rem;
  }
</style>

<div class="box">
  This is a box with 5px inline borders.
</div>
Try It Yourself

How It Works

Three longhands work together: width sets thickness on both inline edges, style makes the lines visible, and color sets the line color.

Example 2 — thin, medium, and thick Keywords

Use keyword widths for quick, browser-defined thickness on both inline edges.

border-inline-width-keywords.css
.thin {
  border-inline: thin solid #2563eb;
}
.medium {
  border-inline: medium solid #2563eb;
}
.thick {
  border-inline: thick solid #2563eb;
}
Try It Yourself

How It Works

thin, medium, and thick are keyword widths. Browsers map them to approximate pixel sizes — useful when you want consistent relative thickness without exact px values.

🎨 Two Values and RTL

Set different start/end widths and test direction-aware layouts.

Example 3 — Different Start and End Widths

Pass two values so inline-start and inline-end can have different thicknesses.

border-inline-width-asymmetric.css
.panel {
  border-inline-width: 2px 8px;
  border-inline-style: solid;
  border-inline-color: #7c3aed;
  padding: 0.75rem 1rem;
  background: #faf5ff;
}
Try It Yourself

How It Works

The first value sets inline-start width; the second sets inline-end. In LTR, that is usually 2px on the left and 8px on the right — without using physical border-left-width or border-right-width.

Example 4 — RTL with 5px Inline Borders

The same inline width applies to both edges in right-to-left layouts.

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

<div class="rtl-box">
  حدود داخلية على جانبي النر
</div>
Try It Yourself

How It Works

One 5px value sets both inline edges. In horizontal RTL, those are still the left and right sides — no separate physical width rules are needed.

🧠 How border-inline-width Works

1

Width reserves space

border-inline-width sets how much room the border takes on both inline edges.

Width
2

Style makes it visible

A visible style such as solid or dashed is required to see the width.

Style
3

Direction maps the edges

Inline-start and inline-end map to the correct physical sides for each writing mode.

Mapping
=

Sized inline borders

Both inline edges show your chosen border thickness.

Modern Browser Support

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

Baseline · Modern browsers

Logical inline widths in today’s browsers

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

Bottom line: Use border-inline-width for direction-aware inline border thickness in modern multilingual projects.

Conclusion

The border-inline-width property controls how thick the borders are on both inline edges. Use it for column dividers, paired accents, and layouts that stay correct in LTR and RTL writing modes.

Combine it with style and color longhands, or use the border-inline shorthand when you want all three values together.

💡 Best Practices

✅ Do

  • Set border-inline-style alongside width for visible borders
  • Use two values when start and end need different thicknesses
  • Prefer logical inline widths over physical left/right rules in RTL layouts
  • Test inline border widths in both LTR and RTL
  • Use the shorthand when width, style, and color are all needed

❌ Don’t

  • Set width alone without a visible border style
  • Assume inline means only one physical side
  • Mix conflicting physical and logical width rules on the same element
  • Rely on keyword widths when you need pixel-perfect design
  • Hard-code RTL overrides when one logical rule suffices

Key Takeaways

Knowledge Unlocked

Five things to remember about border-inline-width

Use these points when sizing both inline edges.

5
Core concepts
02

Default medium

~3px.

Default
🔀03

thin / thick

Keywords.

Values
🌐04

RTL ready

Direction-aware.

Logical
🛠05

Needs style

Width longhand.

Usage

❓ Frequently Asked Questions

The border-inline-width property sets how thick the border is on both inline edges — inline-start and inline-end — using one or two width values.
The initial value is medium, which browsers typically render as about 3px when a visible border style is set.
In horizontal left-to-right text, it usually affects the left and right sides — both inline edges along the text flow.
Width alone does not draw a border. You also need a visible border-inline-style such as solid or dashed, and usually a color.
border-width sets thickness on all four sides. border-inline-width only affects the two inline edges and can use two values for start and end separately.

Practice in the Live Editor

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