CSS border-block-end Property
The border-block-end shorthand property sets the width, style, and color of an element's logical block-end border.
Unlike border-bottom, which always targets the physical bottom edge, border-block-end follows the element's writing mode. It is useful for section dividers, headings, panels, and other components that need to adapt to horizontal or vertical writing systems.
border-block-end Syntax
selector {
border-block-end: 3px solid #1769aa;
}
The shorthand accepts up to three components: border width, border style, and border color. These components can appear in any order.
.complete {
border-block-end: 3px solid blue;
}
.width-and-style {
border-block-end: 4px dashed;
}
.style-and-color {
border-block-end: dotted red;
}
.style-only {
border-block-end: solid;
}
.no-border {
border-block-end: none;
}
The following declarations produce the same border:
.first {
border-block-end: 3px solid red;
}
.second {
border-block-end: solid red 3px;
}
.third {
border-block-end: red 3px solid;
}
CSS-wide keywords are also supported, including inherit, initial, revert, revert-layer, and unset.
.inherited {
border-block-end: inherit;
}
.reset {
border-block-end: initial;
}
A CSS-wide keyword must be used by itself rather than combined with width, style, or color values.
The shorthand affects only the block-end border. It does not change the block-start border or the two inline borders.
Property Values
| Value | Description |
|---|---|
<line-width> |
Sets the border thickness using a nonnegative length or the thin, medium, or thick keyword. |
<line-style> |
Sets the border's appearance using values such as solid, dashed, dotted, or double. |
<color> |
Sets the border color using a valid CSS color value. |
none |
Specifies no border line and gives the border a used width of zero. |
hidden |
Suppresses the border line and has special precedence when resolving collapsed table borders. |
The initial component values are medium for width, none for style, and currentColor for color.
The property is not inherited. Its constituent properties determine the computed values and animation behavior.
How border-block-end Works
The border-block-end shorthand sets three logical border properties at once:
border-block-end-width- controls the border thickness.border-block-end-style- controls the border's line style.border-block-end-color- controls the border color.
Expanding the Shorthand
.panel {
border-block-end: 4px solid #1769aa;
}
This declaration is equivalent to:
.panel {
border-block-end-width: 4px;
border-block-end-style: solid;
border-block-end-color: #1769aa;
}
Only One Logical Side Is Affected
.section {
border-block-end: 2px solid #1769aa;
}
In the default horizontal writing mode, this creates a bottom border without adding borders to the other three sides.
A Visible Style Is Required
.invisible {
border-block-end: 4px red;
}
.visible {
border-block-end: 4px solid red;
}
The first declaration does not produce a visible border because its omitted style resets to none. The second declaration displays a solid red border.
The Shorthand Resets Its Components
.panel {
border-block-end-color: red;
border-block-end: 3px dashed blue;
}
The later shorthand replaces the earlier color with blue and sets the width and style at the same time.
Writing Modes and Border Mapping
The physical location of the block-end border depends on the element's writing-mode.
| Writing Mode | Block-End Side |
|---|---|
horizontal-tb |
Bottom |
vertical-rl |
Left |
vertical-lr |
Right |
sideways-rl |
Left |
sideways-lr |
Right |
Horizontal Writing Mode
.horizontal-panel {
writing-mode: horizontal-tb;
border-block-end: 5px solid #1769aa;
}
The border appears along the physical bottom edge.
Vertical Right-to-Left Writing Mode
.vertical-right-panel {
writing-mode: vertical-rl;
border-block-end: 5px solid #1769aa;
}
The border appears along the physical left edge because the block axis progresses from right to left.
Vertical Left-to-Right Writing Mode
.vertical-left-panel {
writing-mode: vertical-lr;
border-block-end: 5px solid #1769aa;
}
The border appears along the physical right edge because the block axis progresses from left to right.
Text Direction
.rtl-panel {
direction: rtl;
writing-mode: horizontal-tb;
border-block-end: 5px solid #1769aa;
}
Changing direction to rtl does not move the block-end border in horizontal writing mode. It remains at the bottom.
The writing-mode property determines the block-axis orientation, while direction influences the inline direction.
Border Width
The width component determines the thickness of the logical block-end border.
Length Values
.thin-line {
border-block-end: 1px solid #1769aa;
}
.medium-line {
border-block-end: 3px solid #1769aa;
}
.thick-line {
border-block-end: 6px solid #1769aa;
}
Valid widths include nonnegative lengths such as px, em, and rem. Negative lengths and percentages are not accepted.
Width Keywords
.thin-border {
border-block-end: thin solid #1769aa;
}
.medium-border {
border-block-end: medium solid #1769aa;
}
.thick-border {
border-block-end: thick solid #1769aa;
}
The browser determines the exact thickness of these keywords. Use explicit lengths when a specific measurement is required.
Using the Width Longhand
.panel {
border-block-end: solid #1769aa;
border-block-end-width: 5px;
}
The first declaration establishes the style and color. The second sets the border thickness.
Zero Width
.zero-width {
border-block-end: 0 solid red;
}
A zero-width border occupies no thickness and is not visible.
Border Style
The style component determines how the block-end border is drawn.
| Value | Appearance |
|---|---|
none |
No visible border. |
hidden |
No visible border, with special collapsed table behavior. |
solid |
A continuous line. |
dashed |
A series of short line segments. |
dotted |
A series of dots. |
double |
Two parallel lines separated by a gap. |
groove |
A recessed or carved appearance. |
ridge |
A raised or embossed appearance. |
inset |
An appearance suggesting the element is pressed inward. |
outset |
An appearance suggesting the element is raised outward. |
Common Border Styles
.solid-example {
border-block-end: 4px solid #1769aa;
}
.dashed-example {
border-block-end: 4px dashed #1769aa;
}
.dotted-example {
border-block-end: 4px dotted #1769aa;
}
.double-example {
border-block-end: 6px double #1769aa;
}
Three-Dimensional Styles
.groove-example {
border-block-end: 8px groove #1769aa;
}
.ridge-example {
border-block-end: 8px ridge #1769aa;
}
.inset-example {
border-block-end: 8px inset #1769aa;
}
.outset-example {
border-block-end: 8px outset #1769aa;
}
The exact appearance of dotted, dashed, and three-dimensional border styles may vary between browsers.
Changing Only the Style
.panel {
border-block-end: 4px solid #1769aa;
border-block-end-style: dashed;
}
The border becomes dashed while retaining its width and color.
Border Color
The color component sets the color of the logical block-end border.
Named Colors
.named-color {
border-block-end: 3px solid navy;
}
Hexadecimal Colors
.hex-color {
border-block-end: 3px solid #1769aa;
}
RGB Colors
.rgb-color {
border-block-end: 3px solid rgb(23 105 170);
}
HSL Colors
.hsl-color {
border-block-end: 3px solid hsl(207 76% 38%);
}
Using currentColor
.matching-border {
color: #1769aa;
border-block-end: 3px solid currentColor;
}
The currentColor keyword uses the element's computed text color. It is also the initial border color when no color is specified.
.automatic-color {
color: #1769aa;
border-block-end: 3px solid;
}
This declaration produces a border that matches the text color.
Transparent Colors
.transparent-border {
border-block-end: 3px solid transparent;
}
The border remains part of the box model but is not visibly painted.
Changing Only the Color
.panel {
border-block-end: 3px solid #1769aa;
border-block-end-color: #d35400;
}
The border changes from blue to orange without changing its width or style.
Omitted Values and Defaults
When a component is omitted from the border-block-end shorthand, it resets to its initial value.
| Component | Initial Value |
|---|---|
| Width | medium |
| Style | none |
| Color | currentColor |
Omitting Width
.example {
border-block-end: solid blue;
}
The width resets to medium.
Omitting Color
.example {
color: #1769aa;
border-block-end: 3px solid;
}
The color resets to currentColor, matching the element's computed text color.
Omitting Style
.example {
border-block-end: 3px blue;
}
The style resets to none, so no visible border appears.
Removing the Block-End Border
.no-end-border {
border-block-end: none;
}
This resets the border style to none, the width to medium, and the color to currentColor.
Although the specified width resets to medium, the used border width is zero when the style is none.
Related Logical Border Properties
CSS provides several logical border properties for styling different sides of an element.
| Property | Purpose |
|---|---|
border-block |
Sets borders on both block-start and block-end sides. |
border-block-start |
Sets the border on the block-start side. |
border-block-end |
Sets the border on the block-end side. |
border-inline |
Sets borders on both inline-start and inline-end sides. |
border-inline-start |
Sets the border on the inline-start side. |
border-inline-end |
Sets the border on the inline-end side. |
Both Block Borders
.panel {
border-block: 2px solid #1769aa;
}
This applies the same border to both logical block sides.
Only the Block-End Border
.panel {
border-block-end: 2px solid #1769aa;
}
This affects only the logical block-end side.
Different Block-Start and Block-End Borders
.panel {
border-block-start: 2px solid #c5d8e8;
border-block-end: 5px solid #1769aa;
}
The two logical block sides receive different border styles while remaining writing-mode-aware.
Combining Block and Inline Borders
.panel {
border-block-end: 4px solid #1769aa;
border-inline-start: 2px dashed #65a6c9;
}
The block-end and inline-start borders adapt independently to the element's writing mode and direction.
Logical vs. Physical Borders
Physical border properties target fixed sides. Logical border properties target sides determined by writing mode and direction.
Using border-bottom
.physical-panel {
border-bottom: 4px solid #1769aa;
}
The border always appears on the physical bottom edge.
Using border-block-end
.logical-panel {
border-block-end: 4px solid #1769aa;
}
The border appears at the bottom in horizontal writing, the left in vertical-rl, and the right in vertical-lr.
Conflicting Declarations
.panel {
border-bottom: 5px solid red;
border-block-end: 3px solid blue;
}
In horizontal-tb, both declarations target the physical bottom border. At equal cascade priority, the later blue declaration wins.
In vertical-rl, the declarations affect different physical sides: border-bottom targets the bottom, while border-block-end targets the left.
When to Use Each Property
Use border-bottom when the border must remain on the physical bottom edge regardless of writing mode.
Use border-block-end when the border should follow the end of the block axis, such as a divider beneath a heading in horizontal writing or along its corresponding side in vertical writing.
Shorthand and Longhand Interactions
The border-block-end shorthand can interact with broader border shorthands and individual longhand properties.
Overriding border-block
.panel {
border-block: 2px solid #1769aa;
border-block-end: 5px dashed #d35400;
}
The first declaration sets both block borders. The second changes only the block-end border.
Resetting a Longhand
.panel {
border-block-end-color: red;
border-block-end: 3px solid blue;
}
The later shorthand replaces the earlier red color with blue.
Changing One Component
.panel {
border-block-end: 3px solid #1769aa;
border-block-end-style: dotted;
}
The border becomes dotted without changing its width or color.
The border Shorthand
.panel {
border-block-end: 5px solid blue;
border: 1px solid gray;
}
The later border shorthand sets all four physical borders, including the side corresponding to block-end.
Declaration Order
When declarations have equal cascade priority and target the same underlying border properties, later declarations generally take precedence.
For predictable results, establish general border styling first and place specific logical border overrides afterward.
Borders and the Box Model
The logical block-end border occupies space in the CSS box model just like a physical border.
The content-box Model
.content-box-panel {
box-sizing: content-box;
block-size: 150px;
padding-block: 20px;
border-block-end: 5px solid #1769aa;
}
The content block size is 150 pixels. The block-axis padding adds 40 pixels, and the block-end border adds 5 pixels, producing a border-box block size of 195 pixels when the block-start border has zero used width.
The border-box Model
.border-box-panel {
box-sizing: border-box;
block-size: 150px;
padding-block: 20px;
border-block-end: 5px solid #1769aa;
}
The declared 150-pixel block size includes the content, block-axis padding, and block-end border.
Avoiding Hover Layout Changes
.interactive-panel {
border-block-end: 3px solid transparent;
}
.interactive-panel:hover {
border-block-end-color: #1769aa;
}
The transparent border reserves space before hover. Changing only the color avoids changing the border thickness.
Rounded Corners
.rounded-panel {
border-block-end: 4px solid #1769aa;
border-radius: 12px;
}
The border-radius property rounds the border box corners. It is separate from border-block-end and is not reset by this shorthand.
Practical Uses
The border-block-end property is useful whenever a decorative border or separator should follow the logical end of a block.
Section Heading Divider
.section-heading {
border-block-end: 3px solid #1769aa;
padding-block-end: 12px;
margin-block-end: 20px;
}
In horizontal writing, this produces a divider beneath the heading. The padding and margin create spacing around the border.
Article Section Separator
.article-section {
border-block-end: 1px solid #d0d7de;
padding-block-end: 24px;
margin-block-end: 24px;
}
The border separates consecutive content sections without requiring a fixed physical bottom border.
Navigation Item Accent
.nav-link {
border-block-end: 3px solid transparent;
}
.nav-link:hover,
.nav-link[aria-current="page"] {
border-block-end-color: #1769aa;
}
The border provides a visual accent for hovered or current navigation items. The transparent initial border helps maintain consistent dimensions.
Form Field Styling
.form-field {
border: 0;
border-block-end: 2px solid #8a99a8;
padding-block: 8px;
}
.form-field:focus-visible {
border-block-end-color: #1769aa;
outline: 2px solid #1769aa;
outline-offset: 2px;
}
This creates an underline-style field while retaining a visible keyboard focus indicator.
Using a Custom Property
.themed-section {
--divider-color: #1769aa;
border-block-end: 3px solid var(--divider-color);
}
A custom property makes the divider color easier to update across multiple components.
border-block-end Example
The following example compares the same border-block-end declaration in three writing modes.
Each box has a 7-pixel solid blue block-end border. The physical position changes according to the writing mode.
<div class="border-block-end-demo">
<div class="demo-item">
<p>horizontal-tb</p>
<div class="demo-box horizontal">Block-end</div>
</div>
<div class="demo-item">
<p>vertical-rl</p>
<div class="demo-box vertical-right">Block-end</div>
</div>
<div class="demo-item">
<p>vertical-lr</p>
<div class="demo-box vertical-left">Block-end</div>
</div>
</div>
.border-block-end-demo {
display: flex;
flex-wrap: wrap;
align-items: flex-start;
gap: 24px;
}
.border-block-end-demo .demo-item {
padding: 10px;
}
.border-block-end-demo .demo-item p {
margin-bottom: 10px;
font-weight: bold;
}
.border-block-end-demo .demo-box {
box-sizing: border-box;
inline-size: 180px;
block-size: 120px;
padding: 15px;
border-block-end: 7px solid #1769aa;
background-color: #e8f2fb;
color: #173b5e;
font-weight: bold;
text-align: center;
}
.border-block-end-demo .horizontal {
writing-mode: horizontal-tb;
}
.border-block-end-demo .vertical-right {
writing-mode: vertical-rl;
}
.border-block-end-demo .vertical-left {
writing-mode: vertical-lr;
}
horizontal-tb
vertical-rl
vertical-lr
In horizontal-tb, the border appears at the bottom of the box.
In vertical-rl, the border appears on the left.
In vertical-lr, the border appears on the right.
The same CSS declaration works in all three cases without requiring separate physical border rules.
Important Considerations
Keep the following points in mind when using border-block-end:
- Logical shorthand: The property sets width, style, and color on the block-end border.
- Writing mode: The physical side affected depends on the element's
writing-mode. - Horizontal writing: The block-end border normally appears at the bottom.
- Vertical writing: The border appears on the left in
vertical-rland the right invertical-lr. - Single side: Only the logical block-end border is affected by this shorthand.
- Component order: Width, style, and color can appear in any order.
- Initial values: Omitted components reset to
medium,none, andcurrentColor. - Border visibility: A visible style and nonzero used width are required for the border to appear.
- Width values: Nonnegative lengths and the
thin,medium, andthickkeywords are supported. - No percentage widths: Percentage values are not valid border widths.
- Color: The color defaults to
currentColorwhen omitted. - Transparent borders: Transparent colors can reserve border space without painting a visible line.
- Longhand properties: Use the width, style, and color longhands to change individual components.
- Other block side: Use
border-block-startto style the opposite logical block side. - Both block sides: Use
border-blockwhen both sides should share the same border styling. - Physical borders: Logical and physical border declarations can target the same side, depending on writing mode.
- Shorthand resets: Later
borderandborder-blockdeclarations can override the block-end border. - Box model: The border contributes to an element's dimensions according to its
box-sizingvalue. - Rounded corners:
border-radiusis separate and is not reset byborder-block-end. - Animation: Border widths and colors can animate, while changes between border styles are discrete.
- Accessibility: Borders used as interactive indicators should have sufficient contrast and should not rely on color alone.
Use border-block-end when a single border should follow the logical end of the block axis. It is especially useful for headings, content dividers, and components designed for multiple writing modes.
Browser Support
The border-block-end property has Baseline Widely available status and is supported in modern versions of Chrome, Edge, Firefox, Safari, and other major browsers.
Standard border width, style, and color values work without vendor prefixes. Newer CSS color functions have separate compatibility requirements.
Standard Declaration
.panel {
border-block-end: 3px solid #1769aa;
}
Physical Border Fallback
.panel {
border-bottom: 3px solid #1769aa;
}
@supports (border-block-end: 3px solid #1769aa) {
.panel {
border-bottom: 0;
border-block-end: 3px solid #1769aa;
}
}
This example provides a physical bottom-border fallback for horizontal writing mode. Supporting browsers replace it with the logical block-end border.
For vertical writing modes, physical fallbacks must be adapted to the corresponding left or right side.
Visit Can I Use? to review current browser compatibility.
Specifications
The border-block-end shorthand is defined in the CSS Logical Properties and Values Module Level 1 specification.
CSS Logical Properties and Values Module Level 1
General border width, style, and color behavior is defined in the CSS Backgrounds and Borders Module Level 3 specification.
