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.
.quote { border-inline-start: 4px solid #2a62d9; padding-inline-start: 1rem; } .field { border-inline: 1px solid #ccc; }
Try it
Syntax
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
noneorhidden)
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
noneand nothing is drawn. - Start vs end. The shorthand styles both sides identically. For a single side use
border-inline-startorborder-inline-end. - Direction aware. The start side is chosen by
directionor thedirattribute, 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-startso the text does not touch it. - Overrides. Declaring
border-inlineafter a more specificborder-inline-startof equal specificity replaces it. Order matters.
Browser support
Supported in all current browsers.
Related
border-blockโ the block-axis counterpartborderโ the physical shorthandpadding-inlineโ logical inner spacedirection- Logical properties
- Lessons: Borders, Writing modes