CSS border-inline-end Property

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

Unlike physical border properties that target a fixed side, border-inline-end follows the element's writing mode and text direction. It can correspond to the right, left, bottom, or top border, depending on how the content flows.

border-inline-end Syntax

selector {
  border-inline-end: 4px solid #1769aa;
}

The shorthand accepts a border width, border style, and border color. The components can appear in any order, and each component is optional.

Width, Style, and Color

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

The logical inline-end border is 4 pixels wide, solid, and blue.

Style and Color

.panel {
  border-inline-end: dashed #27ae60;
}

The border uses a dashed green style with the initial medium width.

Width and Style

.panel {
  border-inline-end: 3px dotted;
}

The border is 3 pixels wide and dotted, using the element's current text color.

Style Only

.panel {
  border-inline-end: double;
}

The border uses the double style with its initial width and color values.

Color Only

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

The color is assigned, but the border is not visible because the omitted style resets to none.

Removing the Border

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

The logical inline-end border is removed.

CSS-Wide Keywords

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

CSS-wide keywords must be used alone and cannot be combined with width, style, or color values.

Property Values

The border-inline-end shorthand combines three border components.

Value Description
<line-width> Specifies the border thickness using a nonnegative length or the keywords thin, medium, or thick.
<line-style> Specifies the border style, such as solid, dashed, dotted, or double.
<color> Specifies the border color using a valid CSS color value.
none Sets the border style to none, preventing a visible border.
hidden Hides the border and has special conflict-resolution behavior in collapsed table borders.

Initial Component Values

Component Initial Value
Border width medium
Border style none
Border color currentcolor

Omitted components are reset to their initial values when the shorthand is applied.

CSS-Wide Keywords

Keyword Behavior
inherit Inherits the corresponding computed border component values from the parent.
initial Resets the components to their initial values.
unset Resets the non-inherited components to their initial values.
revert Reverts the components according to cascade origin rules.
revert-layer Reverts the components according to cascade layer rules.

The shorthand does not have a separate computed value. Its three longhand components determine the resulting border.

How It Works

The browser determines which physical edge corresponds to inline-end and applies the specified border to that edge.

Step 1: Establish the Writing Mode

.panel {
  writing-mode: horizontal-tb;
}

The inline axis runs horizontally.

Step 2: Establish the Text Direction

.panel {
  direction: ltr;
}

In horizontal left-to-right writing, inline-end corresponds to the physical right edge.

Step 3: Apply the Border

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

The browser paints a 4-pixel solid blue border on the right edge.

Step 4: Reverse the Direction

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

The same declaration now paints the border on the left edge.

Step 5: Change the Writing Mode

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

The inline axis runs vertically, so the border appears on the bottom edge.

This behavior allows the same CSS declaration to adapt to different writing systems without replacing physical border properties manually.

The Inline-End Edge

The inline-end edge is the logical side where inline content progresses toward the end of a line.

Horizontal Left-to-Right

Inline content progresses from left to right, so inline-end corresponds to the right edge.

Horizontal Right-to-Left

Inline content progresses from right to left, so inline-end corresponds to the left edge.

Vertical Top-to-Bottom

When inline content progresses from top to bottom, inline-end corresponds to the bottom edge.

Vertical Bottom-to-Top

When inline content progresses from bottom to top, inline-end corresponds to the top edge.

A Single Logical Edge

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

Only the logical inline-end edge receives this border. The inline-start edge is not changed.

Logical Edge vs. Content End

Inline-end refers to the logical end side of the inline axis. It does not mean the border follows the last word or character in the content.

The border is painted along the corresponding edge of the element's border box.

Writing Modes

The writing-mode property determines the orientation of the inline axis, while direction determines its progression.

Horizontal Writing Mode

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

The border appears on the right.

Vertical Right-to-Left Writing Mode

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

The border appears on the bottom.

Vertical Left-to-Right Writing Mode

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

The border also appears on the bottom.

Vertical Writing With RTL Direction

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

The border appears on the top because the inline progression is reversed.

Physical Edge Mapping

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

The inline-end border follows the logical mapping rather than a fixed physical side.

Text Direction

The direction property influences which physical side represents inline-end.

Left-to-Right Direction

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

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

Right-to-Left Direction

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

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

HTML Direction 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-end: 5px solid #1769aa;
}

The same CSS declaration places the border on the appropriate logical ending edge for each element.

Direction-Aware Components

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

Logical padding, margins, and borders can be combined to create components that adapt to text direction.

Use the HTML dir attribute to establish the direction of document content, especially when supporting right-to-left languages.

Border Width

The width component determines the thickness of the logical inline-end border.

Pixel Width

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

The border is 5 pixels thick.

thin Keyword

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

The border uses the browser's thin width.

medium Keyword

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

The border uses the browser's medium width.

thick Keyword

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

The border uses the browser's thick width.

Relative Width

.panel {
  border-inline-end: 0.25rem solid #1769aa;
}

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

Width Longhand

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

The width can be set independently using border-inline-end-width.

Zero Width

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

The border has zero thickness and is not visible.

Negative border widths are invalid. Percentage values are not supported by the border-width component.

Border Style

The style component controls how the inline-end border is drawn.

Solid

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

The border appears as a continuous line.

Dashed

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

The border appears as a dashed line.

Dotted

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

The border appears as a dotted line.

Double

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

The border contains two parallel lines separated by a gap.

Groove

.groove-panel {
  border-inline-end: 6px groove #1769aa;
}

The border uses a grooved appearance.

Ridge

.ridge-panel {
  border-inline-end: 6px ridge #1769aa;
}

The border uses a raised ridge appearance.

Inset

.inset-panel {
  border-inline-end: 6px inset #1769aa;
}

The border uses inset-style shading.

Outset

.outset-panel {
  border-inline-end: 6px outset #1769aa;
}

The border uses outset-style shading.

none

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

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

hidden

.hidden-panel {
  border-inline-end: hidden;
}

The border is hidden and has special behavior in collapsed table-border conflict resolution.

Style Longhand

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

The style can be changed independently without resetting the width or color.

Border Color

The color component determines the color of the logical inline-end border.

Named Color

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

Hexadecimal Color

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

RGB Color

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

HSL Color

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

Transparent Color

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

The border retains its thickness but becomes visually transparent.

currentcolor

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

The border uses the element's computed text color.

Color Longhand

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

The later declaration changes the border color to green without changing its width or style.

CSS Custom Property

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

Custom properties make it easier to reuse and update border colors across components.

Shorthand and Longhands

The border-inline-end shorthand sets three individual properties.

Longhand Property Purpose
border-inline-end-width Controls the inline-end border thickness.
border-inline-end-style Controls the inline-end border style.
border-inline-end-color Controls the inline-end border color.

Shorthand Declaration

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

Equivalent Longhands

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

Both approaches produce the same border.

Changing Only the Width

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

The border becomes 8 pixels thick without changing its style or color.

Changing Only the Style

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

The border becomes dashed while retaining its width and color.

Changing Only the Color

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

The border becomes green while retaining its width and style.

Shorthand Reset Behavior

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

The second declaration resets the width to medium and the color to currentcolor, while setting the style to solid.

Use the shorthand when setting the complete border and longhands when changing individual components.

Logical vs. Physical Borders

Physical border properties target fixed edges, while border-inline-end targets the logical ending edge of the inline axis.

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

Physical Right Border

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

The border always appears on the physical right side.

Logical Inline-End Border

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

The border follows the logical inline-end side.

Horizontal LTR

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

The logical border maps to the physical right edge.

Horizontal RTL

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

The logical border maps to the physical left edge.

Avoiding Conflicting Declarations

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

In horizontal left-to-right writing, both declarations target the same physical right border. The cascade determines which component values apply.

Avoid mixing logical and physical border declarations that target the same edge unless the override is intentional.

Inline-Start vs. Inline-End

The border-inline-start and border-inline-end properties style opposite logical edges of the inline axis.

Inline-Start Border

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

The border appears on the logical beginning edge of the inline axis.

Inline-End Border

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

The border appears on the logical ending edge of the inline axis.

Combining Both Borders

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

The element receives a blue border at inline-start and a green border at inline-end.

Direction Reversal

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

In horizontal right-to-left writing, the blue border appears on the right and the green border on the left.

Comparison Table

Direction Inline-Start Inline-End
Horizontal LTR Left Right
Horizontal RTL Right Left
Vertical, top-to-bottom Top Bottom
Vertical, bottom-to-top Bottom Top

Use the start and end properties when the two logical sides need different border appearances.

border-inline Comparison

The border-inline shorthand styles both inline edges, while border-inline-end styles only the ending edge.

Both Inline Borders

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

Both inline-start and inline-end receive matching borders.

Inline-End Only

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

Only inline-end receives the border.

Override the Ending Border

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

The inline-start border remains blue and solid. The inline-end border becomes thicker, dashed, and green.

Shorthand After the Ending Border

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

The later border-inline declaration replaces the inline-end settings and applies matching borders to both sides.

Choosing the Appropriate Property

Property Use
border-inline Apply matching borders to both inline edges.
border-inline-start Style only the logical beginning edge.
border-inline-end Style only the logical ending edge.

Box Model and Layout

The inline-end border contributes to the element's border box and can affect its outer dimensions.

Content-Box Sizing

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

With the default content-box sizing and horizontal writing, the border adds 5 pixels to the element's outer width.

Border-Box Sizing

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

With border-box sizing, the declared width includes the padding and border.

Logical Padding

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

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

Logical Margin

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

The margin creates space outside the inline-end border.

Transparent Border

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

The border remains part of the layout even though it is visually transparent.

No Border

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

The computed border width becomes zero, removing its contribution to the box dimensions.

In vertical writing modes, the inline-end border can contribute to the element's physical height instead of its width.

Responsive Design

Logical borders can adapt to different viewport sizes and writing modes without changing their logical meaning.

Responsive Border Width

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

The border becomes thinner on smaller screens.

Responsive Border Color

.responsive-panel {
  border-inline-end: 5px solid #1769aa;
}
@media (max-width: 600px) {
  .responsive-panel {
    border-inline-end-color: #27ae60;
  }
}

The border changes color without changing its thickness or style.

Container Query

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

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

Fluid Border Width

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

The border thickness adjusts with viewport width while remaining within the specified limits.

Writing-Mode Change

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

The border moves from the right edge to the bottom edge when the writing mode changes, assuming left-to-right inline progression.

Dark Color Scheme

.responsive-panel {
  border-inline-end: 5px solid #1769aa;
}
@media (prefers-color-scheme: dark) {
  .responsive-panel {
    border-inline-end-color: #66b3ff;
  }
}

The border uses a lighter color when the user prefers a dark color scheme.

Practical Uses

The border-inline-end property is useful for navigation separators, content panels, sidebar accents, and direction-aware interface components.

Navigation Separator

.nav-item {
  padding-inline: 16px;
  border-inline-end: 1px solid #cccccc;
}

Each navigation item receives a separator on its logical ending edge.

Content Panel Accent

.content-panel {
  padding: 24px;
  border-inline-end: 5px solid #1769aa;
  background-color: #f3f8fc;
}

The panel receives a colored accent along its inline-end edge.

Sidebar Divider

.sidebar {
  padding-inline-end: 24px;
  border-inline-end: 2px solid #dddddd;
}

The divider follows the sidebar's logical ending edge.

Highlighted Information

.information-panel {
  padding: 20px;
  border-inline-end: 6px double #27ae60;
  background-color: #f4fbf6;
}

The panel uses a double green border to emphasize its logical ending edge.

Hover Accent

.interactive-panel {
  padding: 20px;
  border-inline-end: 4px solid transparent;
}
.interactive-panel:hover {
  border-inline-end-color: #1769aa;
}

The border becomes visible on hover without changing the element's dimensions.

Active Navigation Item

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

The current navigation item receives a visible inline-end border.

Animated Border Color

.animated-panel {
  border-inline-end: 5px solid #1769aa;
  transition: border-inline-end-color 0.3s ease;
}
.animated-panel:hover {
  border-inline-end-color: #27ae60;
}

The border color transitions smoothly when the element is hovered.

border-inline-end Example

The following example demonstrates how the same border-inline-end declaration maps to different physical sides based on writing mode and direction.

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

Each example uses the same border declaration. The writing mode and direction determine where the border appears.

Browser Result

Horizontal LTR

Inline-end

Horizontal RTL

Inline-end

Vertical RL

Inline-end

Vertical RTL

Inline-end

The first example uses horizontal left-to-right writing, placing the border on the right.

The second example reverses the direction, moving the border to the left.

The third example uses vertical writing with left-to-right inline progression, placing the border on the bottom.

The fourth example uses vertical writing with right-to-left inline progression, placing the border on the top.

This demonstrates how border-inline-end follows the logical ending edge rather than a fixed physical side.

Important Considerations

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

  • Purpose: Sets the width, style, and color of the logical inline-end border.
  • Shorthand: Combines three inline-end border longhands.
  • Logical edge: Targets the ending side of the inline axis.
  • Writing mode: Determines whether the inline axis runs horizontally or vertically.
  • Text direction: Determines which physical side corresponds to inline-end.
  • Horizontal LTR: The border appears on the right.
  • Horizontal RTL: The border appears on the left.
  • Vertical top-to-bottom: The border appears on the bottom.
  • Vertical bottom-to-top: The border appears on the top.
  • Width: Accepts nonnegative lengths or thin, medium, and thick.
  • Style: Accepts standard border styles such as solid, dashed, dotted, and double.
  • Color: Accepts valid CSS color values.
  • Component order: Width, style, and color may appear in any order.
  • Omitted components: Reset to their initial values.
  • Default width: The initial width is medium.
  • Default style: The initial style is none.
  • Default color: The initial color is currentcolor.
  • Visibility: A visible border requires a nonzero width and a visible border style.
  • Inheritance: Border width, style, and color components are not inherited.
  • Box model: The border contributes to the element's dimensions when it has a nonzero computed width.
  • Transparent colors: Preserve border space while making the border visually transparent.
  • Longhands: Use individual properties to change width, style, or color independently.
  • Physical borders: Avoid unintended conflicts with physical border declarations.
  • Inline-start: Use border-inline-start for the opposite logical edge.
  • Both inline edges: Use border-inline when both sides need matching borders.
  • Border images: The shorthand does not set border-image properties.
  • Animation: Compatible widths and colors can animate, while border styles change discretely.
  • Browser support: Modern browsers support the standard property without vendor prefixes.

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

Browser Support

The border-inline-end 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-end: 5px solid #1769aa;
}

Right-to-Left Direction

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

Vertical Writing Mode

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

These examples use standard CSS logical border syntax.

Physical Border Fallback

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

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

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

Specifications

The border-inline-end 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 the logical inline-end border maps to physical sides according to writing mode and direction.

Border widths, styles, and colors are also defined in the CSS Backgrounds and Borders specification.

CSS Backgrounds and Borders Module Level 3