CSS border-inline-start-width Property

The border-inline-start-width property sets the thickness of an element's logical inline-start border without changing its style or color.

The physical edge affected depends on the element's writing mode and text direction. In horizontal left-to-right writing, it controls the left border width. In horizontal right-to-left writing, it controls the right border width. In vertical writing modes, it controls the top or bottom border width.

border-inline-start-width Syntax

The property accepts a non-negative CSS length, one of three width keywords, or a CSS-wide keyword.

selector {
  border-inline-start-width: 5px;
}

Pixel Width

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

Relative Width

.panel {
  border-inline-start-width: 0.3em;
}

Thin Border

.panel {
  border-inline-start-width: thin;
}

Medium Border

.panel {
  border-inline-start-width: medium;
}

Thick Border

.panel {
  border-inline-start-width: thick;
}

Zero Width

.panel {
  border-inline-start-width: 0;
}

Calculated Width

.panel {
  border-inline-start-width: calc(2px + 0.2em);
}

CSS-Wide Keywords

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

Negative lengths and percentage values are not valid for this property. CSS-wide keywords must be used alone.

Property Values

The border-inline-start-width property accepts the same width values as the corresponding physical border-width properties.

Value Description
<length> A non-negative CSS length, such as 2px, 0.25em, or 0.3rem.
thin A thin border width determined by the browser.
medium A medium border width determined by the browser.
thick A thick border width determined by the browser.
0 Sets the border width to zero.
inherit Inherits the computed border width from the parent element.
initial Resets the property to medium.
unset Resets the property to medium because the property is not inherited.
revert Reverts the property according to cascade origin rules.
revert-layer Reverts the property according to cascade layer rules.

Property Characteristics

Characteristic Value
Initial value medium
Inherited No
Applies to Elements that support the corresponding border-width properties
Computed value Absolute length, or zero when the corresponding border style is none or hidden
Animation type By computed length
Percentages Not accepted
Property type Longhand
Logical axis Inline axis

The initial value of medium does not create a visible border by itself. The border style must also allow the border to be drawn.

How It Works

The browser determines the logical inline-start edge and applies the specified border thickness to the corresponding physical border.

Step 1: Set the Width

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

No border is visible if the border style remains at its initial value of none.

Step 2: Add a Style

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

The border becomes visible and uses currentcolor as its color unless another color is specified.

Step 3: Add a Color

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

The border becomes a 5-pixel solid blue line.

Step 4: Change the Width

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

The border becomes thicker without changing its style or color.

Step 5: Change the Direction

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

In horizontal writing mode, the border moves to the right edge.

The property determines thickness, while writing mode and direction determine which edge receives it.

Writing Modes and Direction

The inline-start edge changes according to the element's writing-mode and direction values.

Writing Mode Direction Physical Border
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

Horizontal Left-to-Right

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

The left border is 5 pixels wide.

Horizontal Right-to-Left

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

The right border is 5 pixels wide.

Vertical Left-to-Right Progression

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

The top border is 5 pixels wide.

Vertical Right-to-Left Progression

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

The bottom border is 5 pixels wide.

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-width: 5px;
  border-inline-start-style: solid;
  border-inline-start-color: #1769aa;
}

The same CSS applies the border to the correct starting edge for each text direction.

Logical border widths are useful for multilingual layouts because they do not require manually switching between physical sides.

Length Values

The border-inline-start-width property supports non-negative CSS length values, including absolute and relative units.

Pixels

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

Pixels provide a predictable CSS border thickness.

em Units

.panel {
  border-inline-start-width: 0.3em;
}

The width is calculated relative to the element's font size.

rem Units

.panel {
  border-inline-start-width: 0.3rem;
}

The width is calculated relative to the root element's font size.

Points

.panel {
  border-inline-start-width: 3pt;
}

Points are an absolute CSS length unit. One point equals one seventy-second of a CSS inch.

Viewport Units

.panel {
  border-inline-start-width: 1vw;
}

The width is based on the viewport width. Large viewports can produce unusually thick borders, so consider limiting the result.

Calculated Width

.panel {
  border-inline-start-width: calc(2px + 0.2em);
}

The calc() function combines compatible length values.

Clamped Width

.panel {
  border-inline-start-width: clamp(2px, 0.5vw, 8px);
}

The clamp() function limits the calculated border width between 2 and 8 pixels.

Zero Width

.panel {
  border-inline-start-width: 0;
}

Zero does not require a unit and removes the border's thickness.

Invalid Percentage

.panel {
  border-inline-start-width: 10%;
}

This declaration is invalid because percentages are not accepted by the property.

Invalid Negative Width

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

Negative border widths are invalid.

For most interface borders, pixel or relative length values provide straightforward control over thickness.

Keyword Widths

The thin, medium, and thick keywords provide browser-defined border widths.

thin

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

The browser draws a thin border.

medium

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

The browser draws a medium-width border.

thick

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

The browser draws a thick border.

Comparing Keywords

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

The relative ordering is thin, medium, and thick. Their exact pixel equivalents are determined by the browser.

Keyword vs. Explicit Length

.keyword-border {
  border-inline-start: thick solid #1769aa;
}
.fixed-border {
  border-inline-start: 6px solid #1769aa;
}

The keyword uses a browser-defined thickness. The explicit length requests a 6-pixel CSS border.

Use a length value when the design requires a specific thickness across browsers.

Border Visibility

Setting a border width does not guarantee that a visible border will appear. The border style and color also affect the result.

Width Without Style

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

The border is not visible because its initial style is none.

Visible Border

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

The border is visible because it has a nonzero width and a visible style.

Style none

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

The computed border width is zero when the style is none.

Style hidden

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

The border is not drawn, and its computed width is zero.

Transparent Color

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

The border is transparent but still occupies space.

Zero Width

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

No visible thickness remains.

Restoring the Border

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

The active panel displays the border because its width becomes nonzero.

When a border does not appear, check its computed style, width, color, and any border-image settings that may affect rendering.

Width, Style, and Color

The logical inline-start border has three primary components: width, style, and color.

Width Longhand

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

Controls thickness.

Style Longhand

.panel {
  border-inline-start-style: dashed;
}

Controls the line pattern.

Color Longhand

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

Controls the border color.

Combined Longhands

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

Creates a 5-pixel dashed blue border.

Equivalent Shorthand

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

The shorthand provides the same result.

Change Only the Width

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

The border becomes 10 pixels wide while remaining dashed and blue.

Change Only the Style

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

The border becomes solid while retaining its width and color.

Change Only the Color

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

The border becomes green while retaining its width and style.

Use the appropriate longhand when changing only one component of an existing border.

Shorthand Properties

The border-inline-start-width property is a longhand component of the border-inline-start shorthand.

border-inline-start Shorthand

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

This sets the width, style, and color together.

Equivalent Longhands

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

The three longhands produce the same result.

Changing Only the Width

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

The border becomes 10 pixels wide without changing its style or color.

border-inline Shorthand

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

Both inline borders are initially 5 pixels wide. The inline-start border becomes 10 pixels wide.

border-inline-width Shorthand

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

The first value applies to inline-start, and the second applies to inline-end.

Same Width on Both Inline Edges

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

Both inline borders become 10 pixels wide.

border Shorthand

.panel {
  border: 2px solid #cccccc;
  border-inline-start-width: 8px;
}

All four borders initially have a width of 2 pixels. The logical inline-start border becomes 8 pixels wide.

Shorthand Reset

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

The later shorthand resets the width to 5 pixels.

Use the width longhand when the border's style and color should remain unchanged.

Physical vs. Logical Border Widths

Physical border-width properties target fixed edges. Logical border-width properties follow the element's writing mode and direction.

Property Target
border-left-width Physical left border
border-right-width Physical right border
border-top-width Physical top border
border-bottom-width Physical bottom border
border-inline-start-width Logical inline-start border

Physical Left Border

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

The left border remains 5 pixels wide regardless of text direction.

Logical Inline-Start Border

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

The 5-pixel border follows the logical starting edge.

Horizontal LTR

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

The left border is 5 pixels wide.

Horizontal RTL

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

The right border is 5 pixels wide.

Vertical Writing

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

The top border is 5 pixels wide.

Physical and Logical Width Conflicts

.panel {
  border: 2px solid #cccccc;
  border-left-width: 8px;
  border-inline-start-width: 5px;
}

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

In horizontal right-to-left writing, the left border remains 8 pixels wide, while the right border becomes 5 pixels wide.

Prefer logical widths when the border should follow the content direction rather than remain on a fixed physical edge.

Inline-Start vs. Inline-End

The border-inline-start-width and border-inline-end-width properties control the thickness of opposite logical borders.

Inline-Start Width

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

The logical starting border is 8 pixels wide.

Inline-End Width

.panel {
  border-inline-end: 4px solid #27ae60;
}

The logical ending border is 4 pixels wide.

Different Widths on Both Edges

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

The inline-start border is 8 pixels wide, and the inline-end border is 4 pixels wide.

Using border-inline-width

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

The two-value shorthand assigns 8 pixels to inline-start and 4 pixels to inline-end.

Same Width on Both Edges

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

Both inline borders are 5 pixels wide.

Horizontal Direction Mapping

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

Use separate longhands when the logical starting and ending edges require different thicknesses.

Box Sizing and Layout

Border width contributes to an element's dimensions. The effect depends on the box-sizing property.

content-box

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

The declared width applies to the content box. Padding and borders increase the total rendered width.

border-box

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

The declared width includes padding and borders, provided the box has sufficient space for its contents and other constraints.

Changing Border Thickness

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

The active panel has a thicker border, which can increase its outer dimensions.

Reserving Border Space

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

Changing only the color preserves the border width and helps prevent layout shifts.

Logical Padding

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

The padding and border follow the same logical starting edge.

Consider box-sizing and surrounding layout constraints when changing border thickness dynamically.

Cascade and Overrides

The CSS cascade determines which border width applies when multiple declarations affect the same physical edge.

Later Declaration

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

The later 10-pixel value wins when both declarations have equal cascade priority.

Higher Specificity

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

The featured panel uses a 10-pixel border because its selector is more specific.

Shorthand Override

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

The later shorthand changes the width to 5 pixels.

Longhand Override

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

The later longhand changes only the width to 10 pixels.

Physical Width Conflict

.panel {
  border: 2px solid #cccccc;
  border-left-width: 8px;
  border-inline-start-width: 5px;
}

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

CSS Layers

@layer base, components;
@layer base {
  .panel {
    border-inline-start-width: 2px;
  }
}
@layer components {
  .panel {
    border-inline-start-width: 5px;
  }
}

For normal declarations, the later layer has higher priority, so the 5-pixel width wins.

When the expected border thickness does not appear, check the border style, shorthand declarations, selector specificity, cascade layers, and logical-to-physical mapping.

CSS Custom Properties

CSS custom properties can store reusable border widths and support component variations.

Global Border Width

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

The border uses the shared width value.

Component Override

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

The featured panel uses a thicker border.

Fallback Width

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

The fallback width is used when the custom property is unavailable or has the guaranteed-invalid value.

Theme-Based Width

:root {
  --accent-border-width: 4px;
}
[data-theme="bold"] {
  --accent-border-width: 8px;
}
.panel {
  border-inline-start: var(--accent-border-width) solid #1769aa;
}

The border thickness follows the selected theme.

Component Variants

.notice {
  --notice-border-width: 4px;
  border-inline-start: var(--notice-border-width) solid #1769aa;
}
.notice.important {
  --notice-border-width: 8px;
}
.notice.subtle {
  --notice-border-width: 2px;
}

Custom properties allow related components to share one border rule while using different thicknesses.

Interactive States

Border width can change in response to hover, focus, selection, and other interface states.

Hover State

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

The border becomes thicker on hover.

Focus State

.form-field {
  border-inline-start: 4px solid #cccccc;
}
.form-field:focus {
  border-inline-start-width: 8px;
  border-inline-start-color: #1769aa;
}

The border becomes thicker and blue when the field receives focus.

Keyboard Focus

.form-field {
  border-inline-start: 4px solid #cccccc;
}
.form-field:focus-visible {
  border-inline-start-width: 6px;
  border-inline-start-color: #1769aa;
  outline: 2px solid #1769aa;
  outline-offset: 2px;
}

The outline provides an additional visible keyboard focus indicator.

Selected Item

.selectable-panel {
  border-inline-start: 3px solid #cccccc;
}
.selectable-panel.is-selected {
  border-inline-start-width: 8px;
  border-inline-start-color: #1769aa;
}

The selected panel uses a thicker blue border.

Current Navigation Item

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

The current navigation item receives a thicker accent border.

Changing border width can affect layout. If maintaining stable dimensions is important, reserve the desired border space and change its color instead.

Transitions and Animation

The border-inline-start-width property can animate between compatible computed length values.

Basic Width Transition

.panel {
  border-inline-start: 4px solid #1769aa;
  transition: border-inline-start-width 0.3s ease;
}
.panel:hover {
  border-inline-start-width: 10px;
}

The border gradually becomes thicker on hover.

Transition With Custom Properties

.panel {
  --border-width: 4px;
  border-inline-start: var(--border-width) solid #1769aa;
  transition: border-inline-start-width 0.3s ease;
}
.panel:hover {
  --border-width: 10px;
}

The resolved border width changes when the custom property changes.

Keyframe Animation

@keyframes border-width-change {
  from {
    border-inline-start-width: 4px;
  }
  to {
    border-inline-start-width: 12px;
  }
}
.animated-panel {
  border-inline-start: 4px solid #1769aa;
  animation: border-width-change 2s ease-in-out infinite alternate;
}

The border width animates between 4 and 12 pixels.

Reduced Motion Preference

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

The transition is disabled when the user requests reduced motion.

Avoiding Layout Changes

.panel {
  border-inline-start: 10px solid transparent;
  transition: border-inline-start-color 0.3s ease;
}
.panel:hover {
  border-inline-start-color: #1769aa;
}

The border thickness remains constant while the color changes, helping prevent layout shifts.

Animating border width may require layout recalculation. Use color transitions when the design does not need a change in thickness.

Responsive Design

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

Media Query

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

The border becomes thinner on smaller screens.

Container Query

.panel-container {
  container-type: inline-size;
}
.responsive-panel {
  border-inline-start: 4px 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.

clamp() for Fluid Width

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

The calculated border width stays within the specified minimum and maximum values.

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 while retaining its thickness.

Responsive Custom Property

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

The border width changes through a custom property.

Logical border widths are useful when a responsive layout must also adapt to different text directions.

Practical Uses

The border-inline-start-width property is useful for controlling the visual emphasis of logical border accents.

Information Notice

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

A medium-thickness border identifies informational content.

Important Notice

.notice.important {
  border-inline-start-width: 10px;
  border-inline-start-color: #c0392b;
}

A thicker border creates stronger visual emphasis.

Blockquote Accent

blockquote {
  padding-inline-start: 20px;
  border-inline-start-width: 4px;
  border-inline-start-style: solid;
  border-inline-start-color: #1769aa;
}

The logical border emphasizes quoted content.

Active Navigation Item

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

The current navigation item receives a thicker border.

Selected Card

.card {
  border-inline-start: 3px solid #dddddd;
}
.card.is-selected {
  border-inline-start-width: 8px;
  border-inline-start-color: #1769aa;
}

The selected card uses a thicker accent border.

Form Validation

.form-field {
  border-inline-start: 3px solid #cccccc;
}
.form-field:invalid {
  border-inline-start-width: 6px;
  border-inline-start-color: #c0392b;
}
.form-field:valid {
  border-inline-start-width: 4px;
  border-inline-start-color: #27ae60;
}

Border thickness and color can provide visual feedback. Include text feedback so validation meaning does not depend on appearance alone.

Theme-Based Width

:root {
  --accent-border-width: 4px;
}
[data-theme="bold"] {
  --accent-border-width: 8px;
}
.card {
  border-inline-start: var(--accent-border-width) solid #1769aa;
}

The border thickness follows the selected theme.

Choose border widths that provide sufficient emphasis without overwhelming nearby content or causing unwanted layout changes.

border-inline-start-width Example

The following example compares several inline-start border widths using the same style and color.

<div class="border-inline-start-width-demo">
  <div class="demo-box thin">2px border</div>
  <div class="demo-box medium">5px border</div>
  <div class="demo-box thick">10px border</div>
  <div class="demo-box extra-thick">15px border</div>
</div>
.border-inline-start-width-demo {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 16px;
}
.border-inline-start-width-demo .demo-box {
  box-sizing: border-box;
  padding: 20px;
  border-inline-start-style: solid;
  border-inline-start-color: #1769aa;
  background-color: #f3f8fc;
  color: #173b5e;
  font-weight: bold;
}
.border-inline-start-width-demo .thin {
  border-inline-start-width: 2px;
}
.border-inline-start-width-demo .medium {
  border-inline-start-width: 5px;
}
.border-inline-start-width-demo .thick {
  border-inline-start-width: 10px;
}
.border-inline-start-width-demo .extra-thick {
  border-inline-start-width: 15px;
}
Browser Result
2px border
5px border
10px border
15px border

Each element uses the same solid blue border. Only the border-inline-start-width value changes.

The increasing widths demonstrate how border thickness affects the visual emphasis of a component.

Important Considerations

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

  • Purpose: Sets the thickness of the logical inline-start border.
  • Property type: Longhand.
  • Initial value: medium.
  • Inheritance: The property is not inherited.
  • Logical edge: Follows the beginning of the inline axis.
  • Writing mode: Determines whether the inline axis is horizontal or vertical.
  • Direction: Determines which physical edge is inline-start.
  • Horizontal LTR: Controls the left border width.
  • Horizontal RTL: Controls the right border width.
  • Vertical top-to-bottom: Controls the top border width.
  • Vertical bottom-to-top: Controls the bottom border width.
  • Length values: Accepts non-negative CSS lengths.
  • Keyword values: Accepts thin, medium, and thick.
  • Percentages: Not accepted.
  • Negative values: Invalid.
  • Zero: Removes the border's thickness.
  • Style none: Produces a computed border width of zero.
  • Style hidden: Also produces a computed border width of zero.
  • Visible border: Requires a suitable border style and nonzero width.
  • Color: Is controlled separately by border-inline-start-color.
  • Style: Is controlled separately by border-inline-start-style.
  • Shorthand: border-inline-start sets width, style, and color together.
  • Inline shorthand: border-inline-width can set both inline border widths.
  • Inline-end: border-inline-end-width controls the opposite logical edge.
  • Physical borders: Can conflict with logical borders when both map to the same edge.
  • Shorthand resets: Later shorthand declarations may override the width.
  • Box sizing: Border thickness can affect an element's rendered dimensions.
  • Animation: Border widths can interpolate between compatible computed lengths.
  • Custom properties: Can provide reusable and theme-dependent widths.
  • Responsive design: Can use media queries and container queries.
  • Accessibility: Do not rely on border thickness alone to communicate important information.
  • Browser support: Modern browsers support the standard property without vendor prefixes.

Use border-inline-start-width when the border already has the desired style and color, and only its thickness needs to change.

Browser Support

The border-inline-start-width 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-width: 5px;
  border-inline-start-style: solid;
  border-inline-start-color: #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;
}

Physical Border Fallback

.panel {
  border-left: 5px solid #1769aa;
}
@supports (border-inline-start-width: 5px) {
  .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-width to review browser compatibility.

Specifications

The border-inline-start-width 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 how logical border widths map to physical borders based on writing mode and direction.

Border-width values and rendering behavior are also defined by the CSS Backgrounds and Borders specification.

CSS Backgrounds and Borders Module Level 3