Skip to content
Tutorials Center
My learning

Topics

CSS Reference ยท Container Queries and Logical Properties

The border-inline property

Reference for the CSS border-inline shorthand: set width, style and color of both inline-axis borders, direction aware, with live examples.

The border-inline shorthand draws a border on both sides of the inline axis: the left and right in horizontal text, or the top and bottom in vertical text. It accepts a width, a style and a color, just like border.

Individual sides are border-inline-start and border-inline-end, which follow the text direction. That makes them the right tool for the classic "accent bar" on one side of a quote or alert, because the bar flips to the other side in right-to-left languages.

CSS
.quote { border-inline-start: 4px solid #2a62d9; padding-inline-start: 1rem; }
.field { border-inline: 1px solid #ccc; }

Try it

Side borders
Accent bar that flips

Syntax

CSS
border-inline: <'border-inline-width'> || <'border-inline-style'> || <'border-inline-color'>;
  • Initial value: medium none currentcolor
  • Applies to: all elements
  • Inherited: no
  • Animatable: width and color yes; style is discrete
  • Computed value: each part as specified, with the width made absolute (0 if the style is none or hidden)

Values

Value Description
Width A length or thin, medium, thick.
Style none, hidden, solid, dashed, dotted, double, groove, ridge, inset, outset. Needed to see anything.
Color Any color; defaults to currentcolor.

Usage notes

  • Always give a style. Without one, the border style is none and nothing is drawn.
  • Start vs end. The shorthand styles both sides identically. For a single side use border-inline-start or border-inline-end.
  • Direction aware. The start side is chosen by direction or the dir attribute, so a single rule works for both left-to-right and right-to-left pages.
  • Spacing. A thick start border usually needs matching padding-inline-start so the text does not touch it.
  • Overrides. Declaring border-inline after a more specific border-inline-start of equal specificity replaces it. Order matters.

Browser support

Supported in all current browsers.