CSS Portal

CSS border-block-width Property

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

Description

The border-block-width is a logical CSS property that controls the thickness of an element’s borders on the block axis - that is, the edges that sit at the “start” and “end” of the block flow for that element. It’s used to set both the block-start and block-end border widths together, providing a convenient way to express border thickness in terms of flow-relative edges rather than physical top/bottom edges. When you set border-block-width, the values are applied to the corresponding long-axis edges of the box, and they can be overridden by the more specific long-edge properties when needed (for example, the individual block-start or block-end width properties).

Because border-block-width is a logical property, the physical edges it affects depend on the element’s writing and directionality context. In left-to-right horizontal writing modes it typically maps to the physical top and bottom edges, but in vertical or right-to-left layouts those mappings change. That makes the property especially useful for internationalized layouts: by using writing-mode and direction aware properties, a single declaration of border-block-width can produce the correct block-edge widths across different writing systems without separate rules for top/bottom.

Practical rendering and layout also depend on other border and box model settings. Whether a border is visible depends on the element’s border style and color, so border-style and border-width (and border-color, if you use it) work together with border-block-width to produce the final drawn border. The way border thickness contributes to the element’s total outer dimensions interacts with the box-sizing model, so consider box-sizing when you need precise control over how border thickness affects layout and element size.

From a stylesheet-authoring perspective, border-block-width is convenient for component and layout rules that should adapt to text direction and writing-mode without maintaining separate top/bottom declarations. It participates in the normal cascade and specificity rules, and it is not inherited by default - you’ll typically set it on the element whose box you want to affect or on a component wrapper. For fine-grained control you can use the corresponding longhand properties to adjust one block edge independently, and you can animate or transition border-width values where supported to produce smooth thickness changes in interactive interfaces.

Definition

Initial value
medium
Applies to
all elements
Inherited
no
Computed value
absolute length; 0 if the border style is none or hidden
Animatable
by computed value type
JavaScript syntax
object.style.borderBlockWidth

Interactive Demo

Example of the Border
Block Width Property

Syntax

border-block-width: <border-width>

Values

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

Example

<div class="container">
<h2>border-block-width examples</h2>
<div class="box one">
<div class="label">border-block-width: 4px;</div>
<p>Top and bottom borders are 4px thick.</p>
</div>
<div class="box two">
<div class="label">border-block-width: 12px;</div>
<p>Top and bottom borders are 12px thick.</p>
</div>
<div class="box three">
<div class="label">border-block-width: thick;</div>
<p>Top and bottom borders use the 'thick' keyword.</p>
</div>
</div>
/* Page styles */
body {
  font-family: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial;
  background: #f3f6fb;
  padding: 24px;
  color: #111827;
}

/* Container */
.container {
  max-width: 640px;
  margin: 0 auto;
}

/* Generic box */
.box {
  padding: 12px 16px;
  margin: 16px 0;
  background: #ffffff;
  border-style: solid;            /* required for border widths to show */
  border-color: #2b7cff;
  border-inline-width: 2px;      /* left/right borders */
  border-block-width: 4px;       /* top/bottom borders (block start/end) */
  border-radius: 6px;
}

/* Variations */
.box.one {
  border-block-width: 4px;
}

.box.two {
  border-block-width: 12px;
}

.box.three {
  border-block-width: thick;
}

/* Label */
.label {
  font-weight: 600;
  margin-bottom: 8px;
}

Browser Support

The following information will show you the current browser support for the CSS border-block-width 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!