CSS border-inline-start Property

The border-inline-start property is a shorthand that sets the width, style, and color of an element's logical inline-start border.

The physical border affected depends on the element's writing mode and text direction. Unlike border-left, which always targets the left edge, border-inline-start follows the beginning of the inline axis, making it useful for layouts that support left-to-right, right-to-left, and vertical text.

border-inline-start Syntax

selector {
  border-inline-start: 5px solid #1769aa;
}

The property accepts a border width, a border style, and a border color. These components can appear in any order, and each can be specified at most once.

Complete Border

.panel {
  border-inline-start: 5px solid #1769aa;
}

Creates a 5-pixel solid blue border on the logical inline-start edge.

Width and Style

.panel {
  border-inline-start: 5px solid;
}

Creates a 5-pixel solid border using the current text color.

Style and Color

.panel {
  border-inline-start: dashed #1769aa;
}

Creates a dashed blue border using the initial medium width.

Style Only

.panel {
  border-inline-start: solid;
}

Creates a solid border using the initial medium width and current text color.

Width Only

.panel {
  border-inline-start: 5px;
}

The width is specified, but the border is not visible because the omitted style resets to none.

Color Only

.panel {
  border-inline-start: #1769aa;
}

The color is specified, but the border is not visible because its style resets to none.

Reordered Values

.panel {
  border-inline-start: solid #1769aa 5px;
}

The order of the width, style, and color components does not change their meaning.

Removing the Border

.panel {
  border-inline-start: none;
}

Removes the visible inline-start border and resets its other components.

CSS-Wide Keywords

.inherited {
  border-inline-start: inherit;
}
.reset {
  border-inline-start: initial;
}
.unset {
  border-inline-start: unset;
}
.reverted {
  border-inline-start: revert;
}
.layer-reverted {
  border-inline-start: revert-layer;
}

CSS-wide keywords must be used alone. They cannot be combined with border widths, styles, or colors.

Property Values

The shorthand combines values from three logical border longhand properties.

Value Description
<line-width> A non-negative CSS length or the keyword thin, medium, or thick.
<line-style> A border style such as solid, dashed, dotted, or double.
<color> A valid CSS color, including named colors, hexadecimal colors, color functions, and currentcolor.
inherit Inherits the computed values of all three longhands from the parent.
initial Resets all three longhands to their initial values.
unset Resets all three longhands to their initial values because they are not inherited.
revert Reverts all three longhands according to cascade origin rules.
revert-layer Reverts all three longhands according to cascade layer rules.

Property Characteristics

Characteristic Value
Property type Shorthand
Initial width medium
Initial style none
Initial color currentcolor
Inherited No
Applies to Elements that support the corresponding border properties
Computed value Determined separately for each longhand
Animation type Determined separately for each longhand
Percentages for width Not allowed
Negative widths Not allowed

The shorthand itself does not have a single computed value. Its width, style, and color components are computed according to their individual longhand definitions.

How It Works

The browser expands border-inline-start into three longhand declarations and maps them to the physical border at the beginning of the inline axis.

Step 1: Define the Border

.panel {
  border-inline-start: 5px solid #1769aa;
}

The declaration sets a width of 5 pixels, a solid style, and a blue color.

Step 2: Determine the Writing Mode

.panel {
  writing-mode: horizontal-tb;
  border-inline-start: 5px solid #1769aa;
}

Horizontal writing mode places the inline axis horizontally.

Step 3: Determine the Direction

.panel {
  writing-mode: horizontal-tb;
  direction: ltr;
  border-inline-start: 5px solid #1769aa;
}

With left-to-right direction, the inline-start edge is the left edge.

Step 4: Reverse the Direction

.panel {
  writing-mode: horizontal-tb;
  direction: rtl;
  border-inline-start: 5px solid #1769aa;
}

The same border moves to the right edge.

Step 5: Use Vertical Writing

.panel {
  writing-mode: vertical-rl;
  direction: ltr;
  border-inline-start: 5px solid #1769aa;
}

The inline-start border appears at the top of the element.

The width, style, and color remain unchanged as the logical border maps to a different physical edge.

The Logical Inline-Start Edge

The inline-start edge is the beginning side of the inline axis. It is not necessarily the physical left edge.

Horizontal Left-to-Right

Inline content progresses from left to right, so inline-start corresponds to the left border.

Horizontal Right-to-Left

Inline content progresses from right to left, so inline-start corresponds to the right border.

Vertical Top-to-Bottom

Inline content progresses from top to bottom, so inline-start corresponds to the top border.

Vertical Bottom-to-Top

Inline content progresses from bottom to top, so inline-start corresponds to the bottom border.

One Logical Border

.panel {
  border-inline-start: 5px solid #1769aa;
}

This declaration sets only the inline-start border. It does not directly set the inline-end, block-start, or block-end borders.

The Border Box

The logical border follows an edge of the element's border box. It does not follow the first character or the position of the first line of text.

This distinction is important when content wraps, changes direction, or contains multiple lines.

Writing Modes

The writing-mode and direction properties work together to determine the physical location of the inline-start border.

Horizontal Writing

.horizontal-panel {
  writing-mode: horizontal-tb;
  direction: ltr;
  border-inline-start: 5px solid #1769aa;
}

The border appears on the left.

Vertical Right-to-Left Writing Mode

.vertical-rl-panel {
  writing-mode: vertical-rl;
  direction: ltr;
  border-inline-start: 5px solid #1769aa;
}

The border appears on the top.

Vertical Left-to-Right Writing Mode

.vertical-lr-panel {
  writing-mode: vertical-lr;
  direction: ltr;
  border-inline-start: 5px solid #1769aa;
}

The border also appears on the top.

Vertical Writing With RTL Direction

.vertical-rtl-panel {
  writing-mode: vertical-rl;
  direction: rtl;
  border-inline-start: 5px solid #1769aa;
}

The border appears on the bottom.

Writing Mode Mapping

Writing Mode Direction Inline-Start Edge
horizontal-tb ltr Left
horizontal-tb rtl Right
vertical-rl ltr Top
vertical-rl rtl Bottom
vertical-lr ltr Top
vertical-lr rtl Bottom
sideways-rl ltr Top
sideways-lr ltr Bottom

The logical border is automatically mapped to the appropriate physical edge without requiring separate left, right, top, or bottom declarations.

Text Direction

The direction property determines whether inline content progresses in the left-to-right or right-to-left direction.

Left-to-Right

.ltr-panel {
  direction: ltr;
  border-inline-start: 5px solid #1769aa;
}

In horizontal writing mode, the border appears on the left.

Right-to-Left

.rtl-panel {
  direction: rtl;
  border-inline-start: 5px solid #1769aa;
}

In horizontal writing mode, the border appears on the right.

Using the HTML dir Attribute

<div dir="ltr" class="directional-panel">
  Left-to-right content
</div>
<div dir="rtl" class="directional-panel">
  Right-to-left content
</div>
.directional-panel {
  padding: 20px;
  border-inline-start: 5px solid #1769aa;
}

The same border declaration adapts to the direction established by each element.

Matching Logical Padding

.directional-panel {
  padding-inline-start: 20px;
  border-inline-start: 5px solid #1769aa;
}

The padding and border remain aligned with the logical starting edge.

Direction-Aware Components

.notice {
  padding-inline-start: 24px;
  border-inline-start: 6px solid #1769aa;
}

The notice uses a starting-edge accent that automatically moves when the content direction changes.

For multilingual content, prefer the HTML dir attribute when specifying text direction rather than relying exclusively on CSS.

Border Width

The width component determines the thickness of the inline-start border.

Pixel Width

.panel {
  border-inline-start: 5px solid #1769aa;
}

Creates a 5-pixel border.

rem Width

.panel {
  border-inline-start: 0.3rem solid #1769aa;
}

Uses a width relative to the root element's font size.

em Width

.panel {
  border-inline-start: 0.3em solid #1769aa;
}

Uses a width relative to the element's computed font size.

thin Keyword

.panel {
  border-inline-start: thin solid #1769aa;
}

Uses a browser-defined thin border width.

medium Keyword

.panel {
  border-inline-start: medium solid #1769aa;
}

Uses a browser-defined medium border width.

thick Keyword

.panel {
  border-inline-start: thick solid #1769aa;
}

Uses a browser-defined thick border width.

Calculated Width

.panel {
  border-inline-start: calc(2px + 0.2rem) solid #1769aa;
}

Combines valid CSS lengths to calculate the border thickness.

Responsive Width

.panel {
  border-inline-start: clamp(2px, 0.5vw, 8px) solid #1769aa;
}

Limits the width to a minimum of 2 pixels and a maximum of 8 pixels.

Zero Width

.panel {
  border-inline-start: 0 solid #1769aa;
}

The border has no thickness and is not visible.

Invalid Percentage

.panel {
  border-inline-start: 10% solid #1769aa;
}

This declaration is invalid because border widths do not accept percentages.

Invalid Negative Width

.panel {
  border-inline-start: -5px solid #1769aa;
}

This declaration is invalid because border widths cannot be negative.

Use border-inline-start-width when only the thickness needs to change without resetting the style or color.

Border Style

The style component determines how the inline-start border is drawn.

Style Description
none No border is drawn. The computed width is zero.
hidden No border is drawn. The computed width is zero and the style has special behavior in collapsed table borders.
solid A single continuous line.
dashed A sequence of dashes.
dotted A sequence of dots.
double Two parallel lines with a gap between them.
groove A border with a carved appearance.
ridge A border with a raised appearance.
inset A border that gives an inset appearance.
outset A border that gives an outset appearance.

Solid Border

.panel {
  border-inline-start: 5px solid #1769aa;
}

Dashed Border

.panel {
  border-inline-start: 5px dashed #1769aa;
}

Dotted Border

.panel {
  border-inline-start: 5px dotted #1769aa;
}

Double Border

.panel {
  border-inline-start: 6px double #1769aa;
}

The total specified width includes both lines and the space between them.

Groove Border

.panel {
  border-inline-start: 8px groove #1769aa;
}

Ridge Border

.panel {
  border-inline-start: 8px ridge #1769aa;
}

Inset Border

.panel {
  border-inline-start: 8px inset #1769aa;
}

Outset Border

.panel {
  border-inline-start: 8px outset #1769aa;
}

No Border

.panel {
  border-inline-start: none;
}

The border is removed, and its computed width becomes zero.

Use border-inline-start-style when changing only the style without resetting the width or color.

Border Color

The color component controls the color of the logical inline-start border.

Hexadecimal Color

.panel {
  border-inline-start: 5px solid #1769aa;
}

Named Color

.panel {
  border-inline-start: 5px solid steelblue;
}

RGB Color

.panel {
  border-inline-start: 5px solid rgb(23 105 170);
}

RGB With Transparency

.panel {
  border-inline-start: 5px solid rgb(23 105 170 / 70%);
}

HSL Color

.panel {
  border-inline-start: 5px solid hsl(207 76% 38%);
}

currentcolor

.panel {
  color: #1769aa;
  border-inline-start: 5px solid currentcolor;
}

The border uses the element's computed text color.

Transparent Border

.panel {
  border-inline-start: 5px solid transparent;
}

The border remains part of the box model but is not visibly colored.

CSS Custom Property

:root {
  --accent-color: #1769aa;
}
.panel {
  border-inline-start: 5px solid var(--accent-color);
}

The custom property provides a reusable border color.

color-mix() Function

.panel {
  border-inline-start: 5px solid color-mix(in srgb, #1769aa 70%, white);
}

The color is calculated by mixing blue with white.

Changing Only the Color

.panel {
  border-inline-start: 5px solid #1769aa;
}
.panel.warning {
  border-inline-start-color: #d35400;
}

The warning panel changes the border color without affecting its width or style.

Use border-inline-start-color when only the border color needs to change.

Omitted Values and Defaults

When one or more components are omitted from border-inline-start, those components reset to their initial values.

Component Initial Value
Width medium
Style none
Color currentcolor

Style Only

.panel {
  border-inline-start: solid;
}

The width becomes medium, and the color becomes currentcolor.

Width and Style

.panel {
  border-inline-start: 5px solid;
}

The color becomes currentcolor.

Style and Color

.panel {
  border-inline-start: dashed #1769aa;
}

The width becomes medium.

Width Only

.panel {
  border-inline-start: 5px;
}

The style becomes none, so the border is not visible.

Resetting Earlier Values

.panel {
  border-inline-start: 8px dashed #1769aa;
  border-inline-start: solid;
}

The later shorthand resets the width to medium, the style to solid, and the color to currentcolor.

Changing Only One Component

.panel {
  border-inline-start: 8px dashed #1769aa;
  border-inline-start-style: solid;
}

The longhand changes only the style, preserving the 8-pixel width and blue color.

When updating a single component, use its longhand property to avoid unintentionally resetting the others.

Longhand Properties

The border-inline-start shorthand expands into three logical border longhands.

Longhand Property Purpose
border-inline-start-width Sets the border thickness.
border-inline-start-style Sets the border line style.
border-inline-start-color Sets the border color.

Shorthand Declaration

.panel {
  border-inline-start: 5px solid #1769aa;
}

Equivalent Longhand Declarations

.panel {
  border-inline-start-width: 5px;
  border-inline-start-style: solid;
  border-inline-start-color: #1769aa;
}

Both examples produce the same border.

Changing the Width

.panel {
  border-inline-start: 5px solid #1769aa;
  border-inline-start-width: 8px;
}

The border becomes 8 pixels wide.

Changing the Style

.panel {
  border-inline-start: 5px solid #1769aa;
  border-inline-start-style: dashed;
}

The border becomes dashed.

Changing the Color

.panel {
  border-inline-start: 5px solid #1769aa;
  border-inline-start-color: #27ae60;
}

The border becomes green.

Using Custom Properties

:root {
  --accent-width: 5px;
  --accent-style: solid;
  --accent-color: #1769aa;
}
.panel {
  border-inline-start: var(--accent-width) var(--accent-style) var(--accent-color);
}

Custom properties allow the border components to be configured independently while retaining a concise shorthand declaration.

Logical vs. Physical Borders

Physical border properties always target the same physical edge. Logical border properties adapt to writing mode and direction.

Property Target Writing-Mode Aware
border-left Physical left border No
border-right Physical right border No
border-top Physical top border No
border-bottom Physical bottom border No
border-inline-start Logical inline-start border Yes

Physical Left Border

.panel {
  border-left: 5px solid #1769aa;
}

The border always appears on the left, regardless of text direction.

Logical Inline-Start Border

.panel {
  border-inline-start: 5px solid #1769aa;
}

The border follows the logical starting edge.

Horizontal LTR

.panel {
  direction: ltr;
  border-inline-start: 5px solid #1769aa;
}

The border appears on the left.

Horizontal RTL

.panel {
  direction: rtl;
  border-inline-start: 5px solid #1769aa;
}

The border appears on the right.

Vertical Writing

.panel {
  writing-mode: vertical-rl;
  direction: ltr;
  border-inline-start: 5px solid #1769aa;
}

The border appears on the top.

Physical and Logical Conflict

.panel {
  border-left: 3px solid #cccccc;
  border-inline-start: 5px solid #1769aa;
}

In horizontal left-to-right writing, both declarations target the left border. When their cascade priority is otherwise equal, the later logical declaration wins.

Prefer logical border properties for direction-aware layouts and avoid mixing logical and physical declarations unless their interaction is intentional.

Inline-Start vs. Inline-End

The border-inline-start and border-inline-end properties control opposite logical borders.

Inline-Start Border

.panel {
  border-inline-start: 5px solid #1769aa;
}

The border appears at the beginning of the inline axis.

Inline-End Border

.panel {
  border-inline-end: 5px solid #1769aa;
}

The border appears at the ending edge of the inline axis.

Both Inline Borders

.panel {
  border-inline-start: 3px solid #1769aa;
  border-inline-end: 8px solid #27ae60;
}

The inline-start border is 3 pixels wide and blue. The inline-end border is 8 pixels wide and green.

Same Border on Both Edges

.panel {
  border-inline: 5px solid #1769aa;
}

The border-inline shorthand applies the same width, style, and color to both inline borders.

Horizontal Direction Comparison

Direction Inline-Start Inline-End
LTR Left Right
RTL Right Left

Vertical Direction Comparison

Inline Progression Inline-Start Inline-End
Top to bottom Top Bottom
Bottom to top Bottom Top

Use border-inline-start for a starting-edge accent, border-inline-end for an ending-edge accent, and border-inline when both edges need the same border.

Shorthand Interactions

The border-inline-start shorthand interacts with broader border shorthands and its own longhand properties.

border-inline Shorthand

.panel {
  border-inline: 3px solid #cccccc;
  border-inline-start: 6px solid #1769aa;
}

Both inline borders initially receive a 3-pixel gray border. The later declaration changes only inline-start to a 6-pixel blue border.

border Shorthand

.panel {
  border: 1px solid #cccccc;
  border-inline-start: 5px solid #1769aa;
}

All physical borders begin with a 1-pixel gray border. The logical inline-start border is then changed to 5 pixels and blue.

Longhand After Shorthand

.panel {
  border-inline-start: 5px solid #1769aa;
  border-inline-start-color: #27ae60;
}

The later longhand changes only the color.

Shorthand After Longhand

.panel {
  border-inline-start-color: #27ae60;
  border-inline-start: 5px solid #1769aa;
}

The later shorthand resets the color to blue.

Width and Style Longhands

.panel {
  border-inline-start: 5px solid #1769aa;
  border-inline-start-width: 8px;
  border-inline-start-style: dashed;
}

The final border is 8 pixels wide, dashed, and blue.

Resetting All Three Components

.panel {
  border-inline-start: 5px solid #1769aa;
  border-inline-start: none;
}

The later shorthand removes the visible border and resets its width and color to their initial values.

Overriding One Logical Edge

.panel {
  border-inline: 5px solid #1769aa;
  border-inline-start: 8px dashed #27ae60;
}

The inline-start border becomes 8 pixels wide, dashed, and green. Inline-end remains 5 pixels wide, solid, and blue.

When multiple border declarations affect the same component, the CSS cascade determines the winning declaration.

Cascade and Overrides

Logical and physical border declarations participate in the same CSS cascade. When they map to the same physical border, their order and cascade priority determine the result.

Later Declaration Wins

.panel {
  border-inline-start: 3px solid #cccccc;
  border-inline-start: 6px solid #1769aa;
}

The later declaration wins when both have the same cascade priority.

Longhand Override

.panel {
  border-inline-start: 5px solid #1769aa;
  border-inline-start-width: 8px;
}

The border becomes 8 pixels wide while retaining its solid style and blue color.

Higher Specificity

.panel {
  border-inline-start: 3px solid #cccccc;
}
.panel.featured {
  border-inline-start: 6px solid #1769aa;
}

The more specific selector applies to elements with both classes.

Physical Border Override

.panel {
  border-inline-start: 5px solid #1769aa;
  border-left: 3px solid #cccccc;
}

In horizontal left-to-right writing, both declarations target the left border. The later physical declaration wins when their cascade priority is otherwise equal.

Direction Change

.panel {
  direction: rtl;
  border-inline-start: 5px solid #1769aa;
  border-left: 3px solid #cccccc;
}

In horizontal right-to-left writing, the logical declaration targets the right border while the physical declaration targets the left. Both can be visible.

CSS Layers

@layer base, components;
@layer base {
  .panel {
    border-inline-start: 3px solid #cccccc;
  }
}
@layer components {
  .panel {
    border-inline-start: 5px solid #1769aa;
  }
}

For normal declarations, the later layer has higher priority, so the component border wins.

Keep logical and physical border rules organized to reduce unexpected overrides when direction or writing mode changes.

Box Model and Layout

The inline-start border contributes to the element's border box. Its width may affect the element's overall dimensions.

Content-Box Sizing

.panel {
  box-sizing: content-box;
  width: 300px;
  padding: 20px;
  border-inline-start: 5px solid #1769aa;
}

In horizontal writing mode, the border contributes to the element's outer width in addition to its content width and padding.

Border-Box Sizing

.panel {
  box-sizing: border-box;
  width: 300px;
  padding: 20px;
  border-inline-start: 5px solid #1769aa;
}

The declared width includes the content, padding, and border.

Logical Padding

.panel {
  padding-inline-start: 24px;
  border-inline-start: 5px solid #1769aa;
}

The padding creates space between the content and the inline-start border.

Increasing Border Width

.panel {
  border-inline-start: 3px solid #1769aa;
}
.panel.emphasized {
  border-inline-start-width: 8px;
}

The emphasized panel has a thicker border, which may change its outer dimensions.

Avoiding Layout Shifts

.panel {
  border-inline-start: 6px solid transparent;
}
.panel:hover {
  border-inline-start-color: #1769aa;
}

The border retains its width in both states, preventing a border-width change from shifting surrounding content.

Vertical Writing

.panel {
  writing-mode: vertical-rl;
  direction: ltr;
  border-inline-start: 5px solid #1769aa;
}

The border appears at the top and contributes to the element's physical height rather than its width.

Border Images

.panel {
  border-inline-start: 12px solid transparent;
  border-image-source: linear-gradient(#1769aa, #27ae60);
  border-image-slice: 1;
}

Border images use the element's border area. The inline-start border width contributes to the dimensions of that area.

Consider the box-sizing model and writing direction when choosing border widths for responsive layouts.

Responsive Design

The border-inline-start property can adapt to viewport size, container size, and writing direction.

Media Query

.responsive-panel {
  border-inline-start: 6px solid #1769aa;
}
@media (max-width: 600px) {
  .responsive-panel {
    border-inline-start-width: 3px;
  }
}

The border becomes thinner on smaller screens.

Container Query

.panel-container {
  container-type: inline-size;
}
.responsive-panel {
  border-inline-start: 3px solid #1769aa;
}
@container (min-width: 500px) {
  .responsive-panel {
    border-inline-start-width: 8px;
  }
}

The border becomes thicker when its query container reaches the specified inline size.

Responsive Width With clamp()

.responsive-panel {
  border-inline-start: clamp(2px, 0.5vw, 8px) solid #1769aa;
}

The border width scales within the specified limits.

Responsive Writing Mode

.responsive-panel {
  writing-mode: horizontal-tb;
  border-inline-start: 5px solid #1769aa;
}
@media (min-width: 900px) {
  .responsive-panel {
    writing-mode: vertical-rl;
  }
}

With left-to-right inline progression, the border moves from the left edge to the top edge when the writing mode changes.

CSS Custom Properties

.responsive-panel {
  --accent-width: 6px;
  --accent-color: #1769aa;
  border-inline-start: var(--accent-width) solid var(--accent-color);
}
@media (max-width: 600px) {
  .responsive-panel {
    --accent-width: 3px;
  }
}

Custom properties allow the border width to change without repeating the entire shorthand.

Animated Border Width

.responsive-panel {
  border-inline-start: 3px solid #1769aa;
  transition: border-inline-start-width 0.3s ease;
}
.responsive-panel:hover {
  border-inline-start-width: 8px;
}
@media (prefers-reduced-motion: reduce) {
  .responsive-panel {
    transition: none;
  }
}

The border width transitions smoothly between the two values. Because changing border width can affect layout, test the effect on nearby content.

Practical Uses

The border-inline-start property is useful for notices, blockquotes, navigation indicators, content sections, and direction-aware layouts.

Information Notice

.info-notice {
  padding: 20px;
  border-inline-start: 5px solid #1769aa;
  background-color: #f3f8fc;
}

The border creates a visual accent at the logical starting edge.

Warning Notice

.warning-notice {
  padding: 20px;
  border-inline-start: 5px solid #d35400;
  background-color: #fff6eb;
}

The orange border helps distinguish warning content.

Blockquote

blockquote {
  margin: 20px 0;
  padding-inline-start: 20px;
  border-inline-start: 4px solid #1769aa;
}

The border remains aligned with the logical beginning of the quoted content.

Active Navigation Item

.nav-link {
  border-inline-start: 4px solid transparent;
}
.nav-link[aria-current="page"] {
  border-inline-start-color: #1769aa;
}

The active navigation item receives a visible starting-edge border without changing its dimensions.

Sidebar Accent

.sidebar-section {
  padding-inline-start: 20px;
  border-inline-start: 3px solid #dddddd;
}

The border separates sidebar content from adjacent space.

Form Field Focus

.form-field {
  border-inline-start: 3px solid #cccccc;
}
.form-field:focus-visible {
  border-inline-start-color: #1769aa;
}

The border changes color when the form field receives keyboard focus.

Theme-Based Accent

:root {
  --accent-color: #1769aa;
}
[data-theme="green"] {
  --accent-color: #27ae60;
}
.panel {
  border-inline-start: 5px solid var(--accent-color);
}

The border color changes with the selected theme.

Right-to-Left Layout

.directional-card {
  padding-inline-start: 24px;
  border-inline-start: 6px solid #1769aa;
}

The same CSS works for both left-to-right and right-to-left content.

Use logical borders when an accent or divider should follow the structure of the content rather than a fixed physical edge.

border-inline-start Example

The following example demonstrates how the same border-inline-start declaration appears on different physical edges depending on writing mode and direction.

<div class="border-inline-start-demo">
  <div class="demo-item">
    <h3>Horizontal LTR</h3>
    <div class="demo-box horizontal-ltr">Left border</div>
  </div>
  <div class="demo-item">
    <h3>Horizontal RTL</h3>
    <div class="demo-box horizontal-rtl">Right border</div>
  </div>
  <div class="demo-item">
    <h3>Vertical LTR</h3>
    <div class="demo-box vertical-ltr">Top border</div>
  </div>
  <div class="demo-item">
    <h3>Vertical RTL</h3>
    <div class="demo-box vertical-rtl">Bottom border</div>
  </div>
</div>
.border-inline-start-demo {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 24px;
}
.border-inline-start-demo .demo-item {
  min-width: 0;
}
.border-inline-start-demo h3 {
  margin-bottom: 12px;
  font-size: 1rem;
}
.border-inline-start-demo .demo-box {
  box-sizing: border-box;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 150px;
  padding: 20px;
  border-inline-start: 6px solid #1769aa;
  background-color: #f3f8fc;
  color: #173b5e;
  font-weight: bold;
  text-align: center;
}
.border-inline-start-demo .horizontal-ltr {
  writing-mode: horizontal-tb;
  direction: ltr;
}
.border-inline-start-demo .horizontal-rtl {
  writing-mode: horizontal-tb;
  direction: rtl;
}
.border-inline-start-demo .vertical-ltr {
  writing-mode: vertical-rl;
  direction: ltr;
}
.border-inline-start-demo .vertical-rtl {
  writing-mode: vertical-rl;
  direction: rtl;
}

All four elements use the same border width, style, and color. Only the writing mode and direction change.

Browser Result

Horizontal LTR

Left border

Horizontal RTL

Right border

Vertical LTR

Top border

Vertical RTL

Bottom border

The horizontal left-to-right example displays the border on the left.

The horizontal right-to-left example displays the border on the right.

The vertical left-to-right example displays the border on the top.

The vertical right-to-left example displays the border on the bottom.

This demonstrates how one logical border declaration can adapt to different writing directions without changing the border values.

Important Considerations

Keep the following points in mind when using border-inline-start:

  • Purpose: Sets the width, style, and color of the logical inline-start border.
  • Shorthand: Combines three logical border longhand properties.
  • Logical edge: Follows the beginning side of the inline axis.
  • Writing mode: Determines whether the inline axis is horizontal or vertical.
  • Direction: Determines the progression of inline content.
  • Horizontal LTR: The border appears on the left.
  • Horizontal RTL: The border appears on the right.
  • Vertical top-to-bottom: The border appears on the top.
  • Vertical bottom-to-top: The border appears on the bottom.
  • Width values: Accepts non-negative lengths or thin, medium, and thick.
  • Style values: Accepts standard CSS border styles.
  • Color values: Accepts valid CSS colors and color functions.
  • Value order: Width, style, and color can appear in any order.
  • Omitted values: Reset to their initial values.
  • Initial width: Is medium.
  • Initial style: Is none.
  • Initial color: Is currentcolor.
  • Inheritance: The longhand properties are not inherited.
  • Visible border: Requires a visible style and a nonzero computed width.
  • Zero width: Produces no visible border thickness.
  • Percentages: Are not accepted for border width.
  • Negative widths: Are invalid.
  • Transparent color: Hides the border color while retaining its thickness.
  • Box model: Border width contributes to the border box.
  • Shorthand resets: Reapplying the shorthand can reset previously specified components.
  • Longhand overrides: Use individual longhands to change only width, style, or color.
  • Physical borders: May conflict with logical borders when both target the same physical edge.
  • Inline-end: Use border-inline-end for the opposite logical border.
  • Both inline borders: Use border-inline when both need the same border.
  • Animation: Individual longhand components have their own animation behavior.
  • Responsive design: Can use media queries, container queries, custom properties, and valid CSS math functions.
  • Browser support: Modern browsers support the standard property without vendor prefixes.

Use border-inline-start when a border should remain attached to the logical beginning of an element across different writing modes and text directions.

Browser Support

The border-inline-start property is widely available in current versions of Chrome, Edge, Firefox, Safari, and other major browsers.

The standard property does not require vendor prefixes in modern browsers.

Basic Declaration

.panel {
  border-inline-start: 5px solid #1769aa;
}

Right-to-Left Direction

.panel {
  direction: rtl;
  border-inline-start: 5px solid #1769aa;
}

Vertical Writing Mode

.panel {
  writing-mode: vertical-rl;
  border-inline-start: 5px solid #1769aa;
}

These examples use standard CSS logical border syntax.

Physical Border Fallback

.panel {
  border-left: 5px solid #1769aa;
}
@supports (border-inline-start: 5px solid #1769aa) {
  .panel {
    border-left: 0;
    border-inline-start: 5px solid #1769aa;
  }
}

This fallback assumes horizontal left-to-right writing. Older browsers use a physical left border, while supporting browsers use the logical inline-start border.

Visit Can I Use? and search for border-inline-start to review browser compatibility.

Specifications

The border-inline-start property is defined in the CSS Logical Properties and Values Module Level 1 specification.

CSS Logical Properties and Values Module Level 1

The specification defines the logical border shorthand and its mapping to physical border edges.

The width, style, and color components follow the rules established by the CSS Backgrounds and Borders specification.

CSS Backgrounds and Borders Module Level 3