CSS border-block-end-style Property
The border-block-end-style property sets the line style of an element's logical block-end border.
It controls whether the border appears solid, dashed, dotted, double, or in another supported style. The physical side affected depends on the element's writing mode. Unlike the border-block-end shorthand, this property changes only the border style, not its specified width or color.
border-block-end-style Syntax
selector {
border-block-end-style: solid;
}
The property accepts one border style keyword or a CSS-wide keyword.
.solid-border {
border-block-end-style: solid;
}
.dashed-border {
border-block-end-style: dashed;
}
.dotted-border {
border-block-end-style: dotted;
}
.double-border {
border-block-end-style: double;
}
.no-border {
border-block-end-style: none;
}
CSS-wide keywords are also supported:
.inherited {
border-block-end-style: inherit;
}
.reset {
border-block-end-style: initial;
}
.unset {
border-block-end-style: unset;
}
.reverted {
border-block-end-style: revert;
}
.layer-reverted {
border-block-end-style: revert-layer;
}
The property accepts only one style value. To set both logical block border styles, use border-block-style.
Property Values
| Value | Description |
|---|---|
none |
Displays no border. This is the initial value. |
hidden |
Hides the border and takes precedence over competing borders in the collapsed table border model. |
solid |
Displays a single continuous line. |
dashed |
Displays a series of short line segments. |
dotted |
Displays a series of dots. |
double |
Displays two parallel lines with a gap between them. |
groove |
Creates a recessed, carved appearance. |
ridge |
Creates a raised, embossed appearance. |
inset |
Creates an inward or sunken appearance. |
outset |
Creates an outward or raised appearance. |
The initial value is none. The property is not inherited, and changes between border styles use discrete animation rather than a gradual interpolation.
Global keywords such as inherit, initial, unset, revert, and revert-layer are also accepted.
How It Works
The border-block-end-style property controls the appearance of one logical border. Its physical position depends on the writing mode.
Setting a Visible Border
.panel {
border-block-end-width: 4px;
border-block-end-style: solid;
border-block-end-color: #1769aa;
}
This creates a 4-pixel solid blue border on the logical block-end side.
Changing an Existing Border Style
.panel {
border-block-end: 4px solid #1769aa;
border-block-end-style: dashed;
}
The second declaration changes the border from solid to dashed without modifying its specified width or color.
Styling Only One Block Side
.panel {
border-block: 3px solid #1769aa;
border-block-end-style: dotted;
}
The block-start border remains solid. Only the block-end border becomes dotted.
Default Style
.panel {
border-block-end-width: 4px;
border-block-end-color: red;
}
Without a visible border style, the border does not appear. The initial style is none, which produces a used border width of zero.
Writing Modes and Border Mapping
Logical border properties follow the block axis defined by the element's writing mode.
| Writing Mode | Physical Block-End Border |
|---|---|
horizontal-tb |
Bottom |
vertical-rl |
Left |
vertical-lr |
Right |
sideways-rl |
Left |
sideways-lr |
Right |
Horizontal Writing
.horizontal {
writing-mode: horizontal-tb;
border-block-end: 4px solid #1769aa;
border-block-end-style: dashed;
}
The dashed border appears along the bottom edge.
Vertical Right-to-Left Writing
.vertical-right {
writing-mode: vertical-rl;
border-block-end: 4px solid #1769aa;
border-block-end-style: dashed;
}
The dashed border appears along the left edge.
Vertical Left-to-Right Writing
.vertical-left {
writing-mode: vertical-lr;
border-block-end: 4px solid #1769aa;
border-block-end-style: dashed;
}
The dashed border appears along the right edge.
Text Direction
.rtl-panel {
direction: rtl;
writing-mode: horizontal-tb;
border-block-end: 4px solid #1769aa;
border-block-end-style: dashed;
}
The border remains at the bottom. Changing direction alone does not change the block axis in horizontal writing mode.
Common Border Styles
The most frequently used border styles are solid, dashed, dotted, and double.
Solid
.solid-example {
border-block-end: 4px solid #1769aa;
}
A continuous line is useful for section dividers, headings, and form controls.
Dashed
.dashed-example {
border-block-end: 4px dashed #1769aa;
}
A dashed border creates a broken line suitable for decorative separators.
Dotted
.dotted-example {
border-block-end: 4px dotted #1769aa;
}
A dotted border uses a sequence of dots. The exact dot shape and spacing can vary between browsers.
Double
.double-example {
border-block-end: 6px double #1769aa;
}
A double border displays two parallel lines. The specified width includes both lines and the gap between them.
Very narrow double borders may not display two clearly separated lines, so a larger width is generally more suitable.
Three-Dimensional Border Styles
CSS also supports border styles that simulate depth through light and dark shading.
Groove
.groove-example {
border-block-end: 8px groove #1769aa;
}
The border appears recessed into the surrounding surface.
Ridge
.ridge-example {
border-block-end: 8px ridge #1769aa;
}
The border appears raised above the surrounding surface.
Inset
.inset-example {
border-block-end: 8px inset #1769aa;
}
The border uses shading that suggests an inward edge.
Outset
.outset-example {
border-block-end: 8px outset #1769aa;
}
The border uses shading that suggests an outward edge.
These styles depend on browser rendering and the specified border color. Their visual effects are more noticeable with thicker borders.
none and hidden
Both none and hidden suppress the visible border, but they differ when resolving collapsed table borders.
Using none
.no-border {
border-block-end-width: 5px;
border-block-end-style: none;
}
The specified width remains 5 pixels, but the used border width becomes zero because the style is none.
Using hidden
.hidden-border {
border-block-end-width: 5px;
border-block-end-style: hidden;
}
The border is not displayed, and its used width is also zero.
Collapsed Table Borders
table {
border-collapse: collapse;
}
td {
border: 2px solid #1769aa;
}
td.no-divider {
border-block-end-style: hidden;
}
In the collapsed table border model, hidden takes precedence over competing borders and suppresses the shared border. The none style has the lowest precedence when resolving border conflicts.
For ordinary elements, both styles remove the visible border and produce a used width of zero.
Border Width and Color
The border style determines how a border is drawn, but its width and color are controlled separately.
Setting All Three Components
.panel {
border-block-end-width: 5px;
border-block-end-style: dotted;
border-block-end-color: #1769aa;
}
This produces a 5-pixel dotted blue border on the logical block-end side.
Using the Shorthand
.panel {
border-block-end: 5px dotted #1769aa;
}
The shorthand produces the same result using one declaration.
Changing Only the Style
.panel {
border-block-end: 5px solid #1769aa;
}
.panel.decorative {
border-block-end-style: double;
}
The decorative class changes the line style while preserving the specified width and color.
Using currentColor
.matching-border {
color: #1769aa;
border-block-end-width: 3px;
border-block-end-style: dashed;
border-block-end-color: currentColor;
}
The border uses the element's computed text color.
Using a Transparent Border
.transparent-border {
border-block-end: 3px solid transparent;
}
The border retains its width and style but is not visibly painted. This can reserve space for later color changes.
Related Border Properties
The border-block-end-style property belongs to the family of logical border properties.
| Property | Purpose |
|---|---|
border-block-end |
Sets the width, style, and color of the block-end border. |
border-block-end-style |
Sets only the block-end border style. |
border-block-end-width |
Sets the block-end border width. |
border-block-end-color |
Sets the block-end border color. |
border-block-start-style |
Sets the opposite logical block border style. |
border-block-style |
Sets the styles of both logical block borders. |
border-inline-style |
Sets the styles of both logical inline borders. |
Different Styles on Both Block Sides
.panel {
border-block-width: 4px;
border-block-color: #1769aa;
border-block-start-style: solid;
border-block-end-style: dashed;
}
The block-start border is solid, while the block-end border is dashed.
Using border-block-style
.panel {
border-block-width: 4px;
border-block-color: #1769aa;
border-block-style: solid dashed;
}
The two-value shorthand sets the block-start style first and the block-end style second.
Logical vs. Physical Styles
.logical {
border-block-end-style: dashed;
}
.physical {
border-bottom-style: dashed;
}
In horizontal writing mode, both properties target the bottom border. In vertical writing, the logical property follows the block-end side while the physical property remains on the bottom.
Shorthand and Longhand Interactions
Border shorthands can reset the block-end border style. The CSS cascade determines which declaration takes effect.
Overriding border-block-end
.panel {
border-block-end: 4px solid #1769aa;
border-block-end-style: dashed;
}
The later longhand changes the style to dashed.
Shorthand Reset
.panel {
border-block-end-style: dashed;
border-block-end: 4px solid #1769aa;
}
The later shorthand replaces the dashed style with solid.
Overriding border-block-style
.panel {
border-block: 4px solid #1769aa;
border-block-style: solid;
border-block-end-style: dotted;
}
The block-start border remains solid, while the block-end border becomes dotted.
The border Shorthand
.panel {
border-block-end-style: dashed;
border: 2px solid gray;
}
The later border shorthand sets all four physical border styles to solid, overriding the earlier logical style.
Cascade Priority
These examples assume equal origin, importance, specificity, and cascade layer priority. A declaration with higher cascade priority can override a later declaration.
For consistent results, define general border rules first and apply specific logical style overrides afterward.
Practical Uses
Different border styles can help distinguish sections, headings, and component states.
Dashed Section Divider
.content-section {
border-block-end: 2px dashed #8a99a8;
padding-block-end: 20px;
margin-block-end: 20px;
}
A dashed logical border separates sections without fixing the divider to the physical bottom edge.
Dotted Heading Accent
.section-heading {
border-block-end: 4px dotted #1769aa;
padding-block-end: 12px;
}
The dotted line adds a decorative accent to a heading.
Double Border Divider
.summary-section {
border-block-end: 6px double #1769aa;
padding-block-end: 16px;
}
A double border can visually separate a summary or concluding section.
Changing a Component State
.status-panel {
border-block-end: 4px solid #1769aa;
}
.status-panel.pending {
border-block-end-style: dashed;
}
The pending class changes the line style without changing its specified width or color.
For important status information, include descriptive text rather than relying only on the border appearance.
border-block-end-style Example
The following example displays four border styles in horizontal writing mode, followed by a dashed border in two vertical writing modes.
<div class="border-block-end-style-demo">
<div class="demo-box solid">Solid</div>
<div class="demo-box dashed">Dashed</div>
<div class="demo-box dotted">Dotted</div>
<div class="demo-box double">Double</div>
<div class="demo-box vertical-right">vertical-rl</div>
<div class="demo-box vertical-left">vertical-lr</div>
</div>
.border-block-end-style-demo {
display: flex;
flex-wrap: wrap;
align-items: flex-start;
gap: 16px;
}
.border-block-end-style-demo .demo-box {
box-sizing: border-box;
inline-size: 160px;
block-size: 100px;
padding: 15px;
border-block-end-width: 7px;
border-block-end-color: #1769aa;
background-color: #e8f2fb;
color: #173b5e;
font-weight: bold;
text-align: center;
}
.border-block-end-style-demo .solid {
border-block-end-style: solid;
}
.border-block-end-style-demo .dashed {
border-block-end-style: dashed;
}
.border-block-end-style-demo .dotted {
border-block-end-style: dotted;
}
.border-block-end-style-demo .double {
border-block-end-style: double;
}
.border-block-end-style-demo .vertical-right {
writing-mode: vertical-rl;
border-block-end-style: dashed;
}
.border-block-end-style-demo .vertical-left {
writing-mode: vertical-lr;
border-block-end-style: dashed;
}
The first four boxes demonstrate how the style keyword changes the appearance of the bottom border in horizontal writing mode.
The final two boxes use dashed with vertical writing modes. The border appears on the left in vertical-rl and on the right in vertical-lr.
All six examples use the same border width and color, making the differences in style and logical positioning easier to compare.
Important Considerations
Keep the following points in mind when using border-block-end-style:
- Logical border style: The property controls the line style of the block-end border.
- Initial value: The default value is
none. - Inheritance: The property is not inherited.
- Writing mode: The physical border affected depends on
writing-mode. - Horizontal writing: The property normally controls the bottom border style.
- Vertical writing: It controls the left border in
vertical-rland the right border invertical-lr. - One style: The property accepts one border style keyword.
- Common styles:
solid,dashed,dotted, anddoubleare frequently used. - Three-dimensional styles:
groove,ridge,inset, andoutsetcreate shaded effects. - none and hidden: Both suppress the border, but
hiddenhas special precedence in collapsed table border conflicts. - Used width: A border with style
noneorhiddenhas a used width of zero. - Width and color: This property does not change the specified border width or color.
- Shorthand: Use
border-block-endto set width, style, and color together. - Both block sides: Use
border-block-styleto set styles on both logical block borders. - Physical borders: Logical and physical style declarations may affect the same border depending on writing mode.
- Shorthand resets: Later border shorthands can override the logical border style.
- Animation: Changes between border styles are discrete rather than smoothly interpolated.
- Browser rendering: Dashed, dotted, and three-dimensional border appearances may vary slightly between browsers.
- Accessibility: Decorative border styles should not be the only indication of important content states.
Use border-block-end-style when the appearance of a logical block-end border needs to change without resetting its width or color.
Browser Support
The border-block-end-style property has Baseline Widely available status and is supported in modern versions of Chrome, Edge, Firefox, Safari, and other major browsers.
The property does not require vendor prefixes. The exact rendering of dashed, dotted, and three-dimensional styles may vary between browsers.
Standard Declaration
.panel {
border-block-end-width: 4px;
border-block-end-style: dashed;
border-block-end-color: #1769aa;
}
Physical Border Fallback
.panel {
border-bottom: 4px dashed #1769aa;
}
@supports (border-block-end-style: dashed) {
.panel {
border-bottom: 0;
border-block-end: 4px dashed #1769aa;
}
}
This fallback assumes horizontal writing mode. Browsers supporting logical borders use the block-end border, while older browsers retain the physical bottom border.
For vertical writing modes, physical fallbacks must be adapted to the appropriate left or right side.
Visit Can I Use? to review current browser compatibility.
Specifications
The border-block-end-style property is defined in the CSS Logical Properties and Values Module Level 1 specification.
CSS Logical Properties and Values Module Level 1
General border style behavior is defined in the CSS Backgrounds and Borders Module Level 3 specification.
