CSS Portal

CSS border-block-style Property

If this site has been useful, we’d love your support! Consider buying us a coffee to keep things going strong!

Description

The CSS property border-block-style controls the visual line style applied to an element’s logical block-start and block-end borders. In practical terms it decides whether those logical block edges are drawn and, if drawn, what pattern or appearance they use - independent of their color or thickness. Because it addresses only the style aspect, it is commonly used together with separate properties that govern border color and border width when you need full control over an element’s borders.

Being a logical property, border-block-style maps to different physical edges depending on the writing mode and text direction of the element. In horizontal writing modes it corresponds to the physical top and bottom edges; in vertical writing modes it maps to the appropriate start and end block faces for that orientation. That mapping makes it particularly useful for internationalized layouts where content flow can change; the property automatically adapts as the element’s writing-mode or direction changes. When working with traditional physical border properties you will often think of border-block-style as the logical counterpart to those physical shorthands such as border-style.

In practical stylesheet authoring, border-block-style interoperates with the other logical border properties and with shorthands. For example, it is typically paired with border-block-width and border-block-color to fully define the appearance of the block-axis borders; assigning values through the overall border shorthand or the physical shorthands can override these logical settings depending on cascade and specificity. Keep in mind it is not inherited by default and is subject to normal cascade rules. Also note interactions with table rendering: when borders are rendered in a collapsed mode the effective border style may be determined by the table’s border-collapse rules and conflict-resolution rules, so the visual result can differ from isolated block elements. Finally, changes to border style are generally discrete (they do not interpolate smoothly like color or length), so transitions involving style changes behave accordingly.

Definition

Initial value
none
Applies to
all elements
Inherited
no
Computed value
as specified
Animatable
yes
JavaScript syntax
object.style.borderBlockStyle

Interactive Demo

Example of the Border
Block Style Property

Syntax

border-block-style: <border-style>

Values

  • <border-style>Specifies the style of the border

Example

<div class="container">
<h1>border-block-style examples</h1>

<div class="box box-one">
<p>Single value: <code>border-block-style: solid;</code></p>
</div>

<div class="box box-two">
<p>Two values (start / end): <code>border-block-style: dashed double;</code></p>
</div>

<div class="box box-vertical">
<p>Vertical writing mode - logical block edges become left/right:</p>
<p><code>writing-mode: vertical-rl;</code></p>
<p><code>border-block-style: groove;</code></p>
</div>
</div>
/* Basic layout */
.container {
    max-width: 720px;
    margin: 32px auto;
    font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

h1 {
    font-size: 18px;
    margin: 0 0 4px 0;
}

/* Common box styles */
.box {
    padding: 16px;
    background: #ffffff;
    box-shadow: 0 1px 2px rgba(0,0,0,0.06);
    min-height: 64px;
    display: flex;
    align-items: center;
}

/* Example 1: single value applies to both block-start and block-end */
.box-one {
    border-block-style: solid;
    border-block-width: 6px;
    border-block-color: #2b8a3e;
}

/* Example 2: two values  -  first is block-start, second is block-end */
.box-two {
    border-block-style: dashed double;
    border-block-width: 6px 8px; /* start / end widths */
    border-block-color: #1e90ff #ff4500; /* start / end colors */
}

/* Example 3: with vertical writing mode */
.box-vertical {
    writing-mode: vertical-rl;
    border-block-style: groove;
    border-block-width: 8px;
    border-block-color: #7b61ff;
    padding: 14px;
    gap: 8px;
}

/* Make code elements look tidy */
code {
    background: #f3f4f6;
    padding: 2px 6px;
    border-radius: 4px;
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, "Roboto Mono", "Segoe UI Mono", "Helvetica Neue", monospace;
}

Browser Support

The following information will show you the current browser support for the CSS border-block-style property. Hover over a browser icon to see the version that first introduced support for this CSS property.

This property is supported by all modern browsers.
Desktop
Chrome
Edge
Firefox
Opera
Safari
Tablets & Mobile
Chrome Android
Firefox Android
Opera Android
Safari iOS
Samsung Internet
Android WebView
-

Last updated by CSSPortal on: 1st January 2026

If this site has been useful, we’d love your support! Consider buying us a coffee to keep things going strong!