CSS border-inline-end-width Property
The border-inline-end-width property sets the thickness of an element's logical inline-end border.
The physical border affected depends on the element's writing mode and text direction. Unlike border-right-width, which always targets the right edge, this property follows the ending edge of the inline axis, making it useful for multilingual and direction-aware layouts.
border-inline-end-width Syntax
selector {
border-inline-end-width: 5px;
}
The property accepts one non-negative CSS length, one border-width keyword, or a CSS-wide keyword. Percentage values and negative lengths are not permitted.
Pixel Width
.panel {
border-inline-end-width: 5px;
}
Sets the specified border width to 5 pixels.
Relative Width
.panel {
border-inline-end-width: 0.3rem;
}
Uses a width relative to the root element's font size.
thin Keyword
.panel {
border-inline-end-width: thin;
}
Uses the browser-defined thin border width.
medium Keyword
.panel {
border-inline-end-width: medium;
}
Uses the browser-defined medium border width.
thick Keyword
.panel {
border-inline-end-width: thick;
}
Uses the browser-defined thick border width.
Zero Width
.panel {
border-inline-end-width: 0;
}
Sets the border width to zero, removing its thickness.
CSS-Wide Keywords
.inherited {
border-inline-end-width: inherit;
}
.reset {
border-inline-end-width: initial;
}
.unset {
border-inline-end-width: unset;
}
.reverted {
border-inline-end-width: revert;
}
.layer-reverted {
border-inline-end-width: revert-layer;
}
CSS-wide keywords must be used alone and cannot be combined with length values or width keywords.
Property Values
The border-inline-end-width property accepts the same width values as the physical border-width longhand properties.
| Value | Description |
|---|---|
<length> |
Specifies a non-negative border width using a valid CSS length unit. |
thin |
Uses a browser-defined thin border width. |
medium |
Uses a browser-defined medium border width. |
thick |
Uses a browser-defined thick border width. |
0 |
Sets the border width to zero. |
inherit |
Inherits the computed value from the parent. |
initial |
Resets the property to medium. |
unset |
Resets the property to its initial value because it 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 properties |
| Computed value | Absolute length, or zero when the corresponding border style is none or hidden |
| Animation type | By computed value type, using length interpolation |
| Percentages | Not allowed |
| Negative values | Not allowed |
The specified width does not necessarily become the computed width. When the corresponding border style is none or hidden, the computed border width is zero.
How It Works
The browser identifies the logical inline-end edge and applies the border width to the corresponding physical side.
Step 1: Specify a Width
.panel {
border-inline-end-width: 5px;
}
The border has a specified width of 5 pixels, but it remains invisible if its style is none.
Step 2: Set a Visible Style
.panel {
border-inline-end-style: solid;
}
The border becomes visible using the initial medium width unless another width has been specified.
Step 3: Set a Color
.panel {
border-inline-end-color: #1769aa;
}
The border receives a blue color.
Step 4: Combine the Longhands
.panel {
border-inline-end-width: 5px;
border-inline-end-style: solid;
border-inline-end-color: #1769aa;
}
The element displays a 5-pixel solid blue border on its logical inline-end edge.
Step 5: Change the Direction
.panel {
direction: rtl;
border-inline-end-width: 5px;
border-inline-end-style: solid;
border-inline-end-color: #1769aa;
}
In horizontal writing mode, the border moves from the right edge to the left edge.
The specified width remains associated with inline-end regardless of its physical position.
The Logical Inline-End Edge
The inline-end edge is the ending side of the inline axis. Its physical location depends on the writing mode and direction.
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
Inline content progresses from top to bottom, so inline-end corresponds to the bottom edge.
Vertical Bottom-to-Top
Inline content progresses from bottom to top, so inline-end corresponds to the top edge.
One Logical Edge
.panel {
border-inline-end-width: 5px;
}
Only the inline-end border width changes. The inline-start border width remains unaffected.
Border Box Position
The border follows the edge of the element's border box. It does not follow the position of the last character in the content.
This makes logical borders useful for components whose content length and writing direction may vary.
Writing Modes
The writing-mode property establishes the orientation of the inline axis, while direction determines the progression of inline content.
Horizontal Writing
.horizontal-panel {
writing-mode: horizontal-tb;
direction: ltr;
border-inline-end: 5px solid #1769aa;
}
The 5-pixel 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 5-pixel 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 5-pixel 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 5-pixel border appears on the top.
Writing Mode 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 border width remains the same unless another CSS declaration changes it. Only the corresponding physical edge changes.
Text Direction
The direction property determines the progression of inline content and affects the physical position of the inline-end border.
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-width: 5px;
border-inline-end-style: solid;
border-inline-end-color: #1769aa;
}
The same CSS places the border on the appropriate logical ending edge of each element.
Direction-Aware Padding
.directional-panel {
padding-inline-end: 20px;
border-inline-end: 5px solid #1769aa;
}
The padding and border remain aligned with the same logical edge.
Use the HTML dir attribute to establish content direction, particularly when supporting right-to-left languages.
Length Values
The property accepts non-negative CSS length values. Different units can be used depending on whether the border should remain fixed or respond to other measurements.
Pixels
.panel {
border-inline-end-width: 5px;
}
Uses a width of 5 CSS pixels.
rem Units
.panel {
border-inline-end-width: 0.3rem;
}
Uses a width relative to the root element's font size.
em Units
.panel {
border-inline-end-width: 0.3em;
}
Uses a width relative to the element's computed font size.
Viewport Width Units
.panel {
border-inline-end-width: 0.5vw;
}
Uses a width based on the viewport width.
Viewport Height Units
.panel {
border-inline-end-width: 0.5vh;
}
Uses a width based on the viewport height.
Container Query Units
.panel-container {
container-type: inline-size;
}
.panel {
border-inline-end-width: 1cqi;
}
Uses a width relative to the query container's inline size.
calc() Function
.panel {
border-inline-end-width: calc(2px + 0.2rem);
}
Combines length values into a calculated border width.
clamp() Function
.panel {
border-inline-end-width: clamp(2px, 0.5vw, 8px);
}
Limits the border width to a minimum of 2 pixels and a maximum of 8 pixels, with a preferred viewport-relative value.
CSS Custom Property
:root {
--border-accent-width: 5px;
}
.panel {
border-inline-end-width: var(--border-accent-width);
}
Custom properties allow border widths to be reused and updated across multiple components.
Invalid Percentage
.panel {
border-inline-end-width: 10%;
}
This declaration is invalid because percentages are not accepted as border widths.
Invalid Negative Width
.panel {
border-inline-end-width: -5px;
}
This declaration is invalid because border widths cannot be negative.
For ordinary interface borders, pixel values and small relative lengths are generally easier to control than viewport-based widths.
Width Keywords
CSS provides three border-width keywords: thin, medium, and thick.
thin
.thin-panel {
border-inline-end: thin solid #1769aa;
}
Displays a thin border using a browser-defined width.
medium
.medium-panel {
border-inline-end: medium solid #1769aa;
}
Displays a medium border. This is the initial width value.
thick
.thick-panel {
border-inline-end: thick solid #1769aa;
}
Displays a thick border using a browser-defined width.
Keyword Comparison
| Keyword | Relative Thickness | Typical Use |
|---|---|---|
thin |
Smallest | Subtle separators |
medium |
Middle | Standard borders |
thick |
Largest | Emphasized borders |
Keyword vs. Explicit Length
.keyword-panel {
border-inline-end: thick solid #1769aa;
}
.length-panel {
border-inline-end: 6px solid #1769aa;
}
The keyword uses a browser-defined thickness, while the length specifies an exact CSS measurement.
The specification does not require every browser to use identical pixel widths for these keywords. Use explicit lengths when precise thickness is important.
Zero Width
A zero border width prevents the inline-end border from occupying thickness in the box model.
Explicit Zero Width
.panel {
border-inline-end-width: 0;
border-inline-end-style: solid;
border-inline-end-color: #1769aa;
}
The border is not visible because its width is zero.
Zero Width Shorthand
.panel {
border-inline-end: 0 solid #1769aa;
}
The shorthand sets the width to zero while retaining the specified style and color.
Removing a Border
.panel {
border-inline-end: 5px solid #1769aa;
}
.panel.no-border {
border-inline-end-width: 0;
}
The second rule removes the border thickness without changing its style or color.
Style none
.panel {
border-inline-end-width: 5px;
border-inline-end-style: none;
}
Although the specified width is 5 pixels, the computed width is zero because the style is none.
Style hidden
.panel {
border-inline-end-width: 5px;
border-inline-end-style: hidden;
}
The computed width is also zero when the border style is hidden.
Transparent Border Alternative
.panel {
border-inline-end: 5px solid transparent;
}
A transparent border retains its thickness in the box model. This differs from setting the width to zero.
Use zero width when the border should occupy no space. Use a transparent color when the border should remain part of the layout but not be visible.
Border Style and Color
The width works with the corresponding border style and color to determine the final appearance.
Width Without Style
.panel {
border-inline-end-width: 5px;
}
The border is not visible if its style remains none.
Width With Solid Style
.panel {
border-inline-end-width: 5px;
border-inline-end-style: solid;
}
The border becomes visible using the element's current text color.
Width With Explicit Color
.panel {
border-inline-end-width: 5px;
border-inline-end-style: solid;
border-inline-end-color: #1769aa;
}
The border is 5 pixels wide and blue.
Dashed Border
.panel {
border-inline-end: 5px dashed #1769aa;
}
The border is dashed and 5 pixels wide.
Dotted Border
.panel {
border-inline-end: 5px dotted #1769aa;
}
The border is dotted and 5 pixels wide.
Double Border
.panel {
border-inline-end: 6px double #1769aa;
}
The double border uses a total width of 6 pixels, including both lines and the gap between them.
Changing Only the Width
.panel {
border-inline-end: 3px solid #1769aa;
}
.panel.emphasized {
border-inline-end-width: 8px;
}
The emphasized panel uses a thicker border while retaining its solid style and blue color.
Use border-inline-end when setting all three border components together. Use border-inline-end-width when changing only the thickness.
Shorthand Interactions
The border-inline-end-width property is a longhand. Border shorthands can set or reset its value.
border-inline-end Shorthand
.panel {
border-inline-end: 5px solid #1769aa;
}
The shorthand sets the width, style, and color of the inline-end border.
Width Longhand After Shorthand
.panel {
border-inline-end: 5px solid #1769aa;
border-inline-end-width: 8px;
}
The later declaration changes the width to 8 pixels.
Shorthand After Width Longhand
.panel {
border-inline-end-width: 8px;
border-inline-end: 5px solid #1769aa;
}
The later shorthand resets the width to 5 pixels.
border-inline Shorthand
.panel {
border-inline: 5px solid #1769aa;
border-inline-end-width: 8px;
}
Both inline borders begin at 5 pixels, but inline-end becomes 8 pixels wide.
border-inline-width Shorthand
.panel {
border-inline: solid #1769aa;
border-inline-width: 3px 8px;
}
The inline-start border is 3 pixels wide, and the inline-end border is 8 pixels wide.
Overriding One Width
.panel {
border-inline: 5px solid #1769aa;
border-inline-width: 3px 8px;
border-inline-end-width: 10px;
}
The inline-start border remains 3 pixels wide, while inline-end becomes 10 pixels wide.
border Shorthand
.panel {
border-inline-end-width: 8px;
border: 5px solid #1769aa;
}
The later border shorthand sets the physical border widths to 5 pixels, overriding the earlier logical width where it maps to the same physical edge.
When multiple declarations target the same border width, the CSS cascade determines the winning value.
Logical vs. Physical Border Widths
Physical border-width properties target fixed edges, while border-inline-end-width follows the logical ending edge of the inline axis.
| Property | Target | Writing-Mode Aware |
|---|---|---|
border-left-width |
Physical left border | No |
border-right-width |
Physical right border | No |
border-top-width |
Physical top border | No |
border-bottom-width |
Physical bottom border | No |
border-inline-end-width |
Logical inline-end border | Yes |
Physical Right Border Width
.panel {
border-right-width: 5px;
border-right-style: solid;
border-right-color: #1769aa;
}
The 5-pixel border always applies to the physical right edge.
Logical Inline-End Border Width
.panel {
border-inline-end-width: 5px;
border-inline-end-style: solid;
border-inline-end-color: #1769aa;
}
The 5-pixel border follows the logical inline-end edge.
Horizontal LTR
.panel {
writing-mode: horizontal-tb;
direction: ltr;
border-inline-end: 5px solid #1769aa;
}
The border appears on the right.
Horizontal RTL
.panel {
writing-mode: horizontal-tb;
direction: rtl;
border-inline-end: 5px solid #1769aa;
}
The border appears on the left.
Conflicting Width Declarations
.panel {
border-right: 5px solid #1769aa;
border-inline-end-width: 8px;
}
In horizontal left-to-right writing, both declarations target the right border width. The later logical declaration wins when their cascade priority is otherwise equal.
Avoid unnecessary conflicts between physical and logical border declarations, especially in multilingual layouts.
Inline-Start vs. Inline-End Widths
The border-inline-start-width and border-inline-end-width properties control opposite logical border edges.
Inline-Start Width
.panel {
border-inline-start-width: 3px;
}
The width applies to the logical beginning edge of the inline axis.
Inline-End Width
.panel {
border-inline-end-width: 8px;
}
The width applies to the logical ending edge of the inline axis.
Combining Both Widths
.panel {
border-inline: solid #1769aa;
border-inline-start-width: 3px;
border-inline-end-width: 8px;
}
The inline-start border is 3 pixels wide, and the inline-end border is 8 pixels wide.
Equivalent Shorthand
.panel {
border-inline: solid #1769aa;
border-inline-width: 3px 8px;
}
The border-inline-width shorthand assigns both widths in one declaration.
Horizontal Direction Comparison
| Direction | Inline-Start Width | Inline-End Width |
|---|---|---|
| LTR | Left border | Right border |
| RTL | Right border | Left border |
Vertical Direction Comparison
| Inline Progression | Inline-Start Width | Inline-End Width |
|---|---|---|
| Top to bottom | Top border | Bottom border |
| Bottom to top | Bottom border | Top border |
Use individual width properties when only one logical border needs to change. Use border-inline-width when assigning both widths together.
border-inline-width Shorthand
The border-inline-width shorthand sets the widths of both logical inline borders.
One Value
.panel {
border-inline-width: 5px;
}
Both inline-start and inline-end use a width of 5 pixels.
Two Values
.panel {
border-inline-width: 3px 8px;
}
The first value applies to inline-start, and the second applies to inline-end.
Keyword Values
.panel {
border-inline-width: thin thick;
}
The inline-start border uses the thin keyword, and inline-end uses the thick keyword.
Complete Border Example
.panel {
border-inline-style: solid;
border-inline-color: #1769aa;
border-inline-width: 3px 8px;
}
Both borders are solid and blue, but their widths differ.
Override the Ending Width
.panel {
border-inline: 5px solid #1769aa;
border-inline-end-width: 10px;
}
The inline-start border remains 5 pixels wide, while inline-end becomes 10 pixels wide.
Shorthand After Longhand
.panel {
border-inline-end-width: 10px;
border-inline-width: 3px 8px;
}
The later shorthand sets inline-start to 3 pixels and inline-end to 8 pixels.
Choosing the Appropriate Property
| Property | Purpose |
|---|---|
border-inline-width |
Sets the widths of both logical inline borders. |
border-inline-start-width |
Sets only the inline-start border width. |
border-inline-end-width |
Sets only the inline-end border width. |
Box Model and Layout
The computed border width contributes to the element's border box and may affect its overall dimensions.
Content-Box Sizing
.panel {
box-sizing: content-box;
width: 300px;
padding: 20px;
border-inline-end: 5px solid #1769aa;
}
In horizontal writing mode, the 5-pixel 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-end: 5px solid #1769aa;
}
The declared width includes the content, padding, and border.
Increasing Border Width
.panel {
border-inline-end: 3px solid #1769aa;
}
.panel.emphasized {
border-inline-end-width: 10px;
}
The emphasized element has a thicker border, which can change its outer dimensions when using content-box sizing.
Hover Width Change
.panel {
border-inline-end: 3px solid #1769aa;
}
.panel:hover {
border-inline-end-width: 8px;
}
The border becomes thicker on hover. This may cause surrounding content to shift.
Avoiding Layout Shifts
.panel {
border-inline-end: 8px solid transparent;
}
.panel:hover {
border-inline-end-color: #1769aa;
}
The border thickness remains constant, so revealing its color does not change the border box dimensions.
Logical Padding
.panel {
padding-inline-end: 24px;
border-inline-end: 5px solid #1769aa;
}
The padding creates space between the content and the logical inline-end border.
Vertical Writing Modes
.panel {
writing-mode: vertical-rl;
direction: ltr;
border-inline-end: 5px solid #1769aa;
}
The inline-end border appears on the bottom and contributes to the element's physical height rather than its width.
Consider the box-sizing model and writing direction when choosing border widths for responsive components.
Responsive Design
The border-inline-end-width property can respond to viewport size, container size, and writing mode.
Media Query Width Change
.responsive-panel {
border-inline-end: 5px solid #1769aa;
}
@media (max-width: 600px) {
.responsive-panel {
border-inline-end-width: 3px;
}
}
The border becomes thinner on smaller screens.
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: 8px;
}
}
The border becomes thicker when the query container reaches the specified inline size.
clamp() for Responsive Width
.responsive-panel {
border-inline-end-style: solid;
border-inline-end-color: #1769aa;
border-inline-end-width: clamp(2px, 0.5vw, 8px);
}
The border width scales within the specified minimum and maximum 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;
}
}
Assuming left-to-right inline progression, the border moves from the right edge to the bottom edge when the writing mode changes.
CSS Custom Property
.responsive-panel {
--accent-width: 5px;
border-inline-end: var(--accent-width) solid #1769aa;
}
@media (max-width: 600px) {
.responsive-panel {
--accent-width: 3px;
}
}
The custom property allows the border width to change without repeating the complete border declaration.
Animated Width
.responsive-panel {
border-inline-end: 3px solid #1769aa;
transition: border-inline-end-width 0.3s ease;
}
.responsive-panel:hover {
border-inline-end-width: 8px;
}
@media (prefers-reduced-motion: reduce) {
.responsive-panel {
transition: none;
}
}
The border width transitions smoothly between values. Because width changes can affect layout, test the effect on surrounding content.
Practical Uses
The border-inline-end-width property is useful for navigation separators, sidebar dividers, highlighted panels, interactive states, and multilingual layouts.
Navigation Separator
.nav-item {
padding-inline: 16px;
border-inline-end: 1px solid #cccccc;
}
The navigation separator follows the logical ending edge of each item.
Sidebar Divider
.sidebar {
padding-inline-end: 24px;
border-inline-end: 2px solid #dddddd;
}
The sidebar uses a subtle divider along its inline-end edge.
Highlighted Panel
.highlight-panel {
padding: 24px;
border-inline-end: 8px solid #1769aa;
}
The thicker border creates a prominent visual accent.
Active Navigation Item
.nav-link {
border-inline-end: 4px solid transparent;
}
.nav-link[aria-current="page"] {
border-inline-end-color: #1769aa;
}
The active item receives a visible border while retaining the same thickness as inactive items.
Hover Emphasis
.interactive-panel {
border-inline-end: 3px solid #1769aa;
}
.interactive-panel:hover {
border-inline-end-width: 8px;
}
The border becomes thicker when the element is hovered.
Form Field Focus
.form-field {
border-inline-end: 3px solid #cccccc;
}
.form-field:focus-visible {
border-inline-end-width: 6px;
border-inline-end-color: #1769aa;
}
The field receives a thicker blue border when it has keyboard focus.
Theme-Based Width
:root {
--accent-border-width: 4px;
}
[data-theme="bold"] {
--accent-border-width: 8px;
}
.panel {
border-inline-end: var(--accent-border-width) solid #1769aa;
}
The border width changes according to a theme-specific custom property.
When border thickness communicates an important state, provide additional visual or text indicators so the meaning remains clear.
border-inline-end-width Example
The following example compares different border widths and demonstrates how the inline-end border changes physical position with writing direction.
<div class="border-inline-end-width-demo">
<div class="demo-item">
<h3>2px - LTR</h3>
<div class="demo-box thin-ltr">2px border</div>
</div>
<div class="demo-item">
<h3>5px - RTL</h3>
<div class="demo-box medium-rtl">5px border</div>
</div>
<div class="demo-item">
<h3>8px - Vertical</h3>
<div class="demo-box thick-vertical">8px border</div>
</div>
<div class="demo-item">
<h3>12px - Vertical RTL</h3>
<div class="demo-box extra-thick-vertical">12px border</div>
</div>
</div>
.border-inline-end-width-demo {
display: grid;
grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
gap: 24px;
}
.border-inline-end-width-demo .demo-item {
min-width: 0;
}
.border-inline-end-width-demo h3 {
margin-bottom: 12px;
font-size: 1rem;
}
.border-inline-end-width-demo .demo-box {
box-sizing: border-box;
display: flex;
align-items: center;
justify-content: center;
min-height: 150px;
padding: 20px;
border-inline-end-style: solid;
border-inline-end-color: #1769aa;
background-color: #f3f8fc;
color: #173b5e;
font-weight: bold;
text-align: center;
}
.border-inline-end-width-demo .thin-ltr {
writing-mode: horizontal-tb;
direction: ltr;
border-inline-end-width: 2px;
}
.border-inline-end-width-demo .medium-rtl {
writing-mode: horizontal-tb;
direction: rtl;
border-inline-end-width: 5px;
}
.border-inline-end-width-demo .thick-vertical {
writing-mode: vertical-rl;
direction: ltr;
border-inline-end-width: 8px;
}
.border-inline-end-width-demo .extra-thick-vertical {
writing-mode: vertical-rl;
direction: rtl;
border-inline-end-width: 12px;
}
Each example uses the same border style and color. Only the width and writing direction change.
2px - LTR
5px - RTL
8px - Vertical
12px - Vertical RTL
The first example displays a 2-pixel border on the right edge.
The second example displays a 5-pixel border on the left edge because the direction is right-to-left.
The third example displays an 8-pixel border on the bottom edge because the writing mode is vertical with left-to-right inline progression.
The fourth example displays a 12-pixel border on the top edge because the writing mode is vertical with right-to-left inline progression.
This demonstrates how border-inline-end-width controls border thickness while logical mapping determines the physical side.
Important Considerations
Keep the following points in mind when using border-inline-end-width:
- Purpose: Sets the thickness of the logical inline-end border.
- Longhand: Controls the width component of
border-inline-end. - Logical edge: Follows the ending side of the inline axis.
- Writing mode: Determines whether the inline axis is horizontal or vertical.
- Text direction: Determines which physical side corresponds to inline-end.
- Horizontal LTR: The width applies to the right border.
- Horizontal RTL: The width applies to the left border.
- Vertical top-to-bottom: The width applies to the bottom border.
- Vertical bottom-to-top: The width applies to the top border.
- Values: Accepts a non-negative CSS length or the keywords
thin,medium, andthick. - Multiple values: Are invalid because the property controls only one logical edge.
- Initial value: Is
medium. - Inheritance: The property is not inherited.
- Percentages: Are not permitted.
- Negative values: Are not permitted.
- Zero width: Removes border thickness.
- Border style: A visible border requires a style other than
noneorhidden. - Computed width: Becomes zero when the border style is
noneorhidden. - Border color: Uses
currentcolorby default. - Box model: Border width can affect an element's overall dimensions.
- Border-box sizing: Includes the border within the declared width and height.
- Responsive units: Can use valid relative lengths and CSS math functions.
- Shorthand resets: Later border shorthands may override the width.
- Physical borders: Avoid unintended conflicts with physical border-width declarations.
- Inline-start: Use
border-inline-start-widthfor the opposite logical edge. - Both inline widths: Use
border-inline-widthto assign widths to both logical inline edges. - Animation: Compatible length values can be interpolated.
- Layout shifts: Changing border width may affect surrounding content.
- Border images: Border images can use the border area established by border widths.
- Browser support: Modern browsers support the standard property without vendor prefixes.
Use border-inline-end-width when the thickness of a border should follow the logical ending edge of an element across different writing modes and text directions.
Browser Support
The border-inline-end-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-end: 5px solid #1769aa;
}
Right-to-Left Direction
.panel {
direction: rtl;
border-inline-end-width: 5px;
border-inline-end-style: solid;
border-inline-end-color: #1769aa;
}
Vertical Writing Mode
.panel {
writing-mode: vertical-rl;
border-inline-end-width: 5px;
border-inline-end-style: solid;
border-inline-end-color: #1769aa;
}
These examples use standard CSS logical border syntax.
Physical Border Fallback
.panel {
border-right: 5px solid #1769aa;
}
@supports (border-inline-end-width: 5px) {
.panel {
border-right: 0;
border-inline-end: 5px solid #1769aa;
}
}
This fallback assumes horizontal left-to-right writing. Older browsers use a physical right border, while supporting browsers use the logical inline-end border.
Visit Can I Use? and search for border-inline-end-width to review browser compatibility.
Specifications
The border-inline-end-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 border edges according to writing mode and direction.
The accepted border-width values and their behavior are defined in the CSS Backgrounds and Borders specification.
