CSS border-block-start-width Property

The border-block-start-width property sets the thickness of an element's logical block-start border.

The physical border affected depends on the element's writing mode. In horizontal writing, it controls the top border width. In vertical writing, it controls the left or right border width. Unlike the border-block-start shorthand, this property changes only the width, leaving the specified border style and color unchanged.

border-block-start-width Syntax

selector {
  border-block-start-width: 4px;
}

The property accepts one nonnegative CSS length, one of three predefined border-width keywords, or a CSS-wide keyword.

.thin-border {
  border-block-start-width: thin;
}
.medium-border {
  border-block-start-width: medium;
}
.thick-border {
  border-block-start-width: thick;
}
.pixel-border {
  border-block-start-width: 5px;
}
.rem-border {
  border-block-start-width: 0.25rem;
}
.zero-border {
  border-block-start-width: 0;
}

CSS-wide keywords are also supported:

.inherited {
  border-block-start-width: inherit;
}
.reset {
  border-block-start-width: initial;
}
.unset {
  border-block-start-width: unset;
}
.reverted {
  border-block-start-width: revert;
}
.layer-reverted {
  border-block-start-width: revert-layer;
}

Only one width value is accepted. To set the widths of both logical block borders, use border-block-width.

Property Values

Value Description
thin A thin border using a browser-defined thickness.
medium A medium border using a browser-defined thickness. This is the initial value.
thick A thick border using a browser-defined thickness.
<length> A nonnegative CSS length, such as 2px, 0.25rem, or 0.2em.
0 Sets the border thickness to zero.
inherit Uses the parent's computed block-start border width.
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 CSS cascade origin rules.
revert-layer Reverts the property according to CSS cascade layer rules.

The initial value is medium, and the property is not inherited. Its animation type is a length.

Negative lengths and percentages are invalid. CSS math functions may be used when they produce a valid, nonnegative length.

How It Works

The border-block-start-width property controls the thickness of one logical border without changing its specified style or color.

Setting a Visible Border

.panel {
  border-block-start-width: 5px;
  border-block-start-style: solid;
  border-block-start-color: #1769aa;
}

This creates a 5-pixel solid blue border on the logical block-start side.

Changing an Existing Border Width

.panel {
  border-block-start: 2px solid #1769aa;
  border-block-start-width: 6px;
}

The second declaration increases the border thickness to 6 pixels while preserving its solid style and blue color.

Changing Only One Block Side

.panel {
  border-block: 2px solid #1769aa;
  border-block-start-width: 6px;
}

The block-start border becomes 6 pixels wide, while the block-end border remains 2 pixels wide.

Using the Initial Width

.panel {
  border-block-start-style: solid;
  border-block-start-color: #1769aa;
}

Because no width is specified, the border uses the initial width of medium.

Width Without a Style

.panel {
  border-block-start-width: 6px;
}

The border remains invisible if its style is none. A width declaration alone does not establish a visible border.

Writing Modes and Border Mapping

The border-block-start-width property follows the logical block-start side instead of a fixed physical edge.

Writing Mode Physical Border Affected
horizontal-tb Top
vertical-rl Right
vertical-lr Left
sideways-rl Right
sideways-lr Left

Horizontal Writing Mode

.horizontal {
  writing-mode: horizontal-tb;
  border-block-start: solid #1769aa;
  border-block-start-width: 5px;
}

The top border is 5 pixels thick.

Vertical Right-to-Left Writing Mode

.vertical-right {
  writing-mode: vertical-rl;
  border-block-start: solid #1769aa;
  border-block-start-width: 5px;
}

The right border is 5 pixels thick.

Vertical Left-to-Right Writing Mode

.vertical-left {
  writing-mode: vertical-lr;
  border-block-start: solid #1769aa;
  border-block-start-width: 5px;
}

The left border is 5 pixels thick.

Text Direction

.rtl-panel {
  direction: rtl;
  writing-mode: horizontal-tb;
  border-block-start: solid #1769aa;
  border-block-start-width: 5px;
}

Changing direction to rtl does not move the block-start border in horizontal writing mode. It remains at the top.

Border Width Keywords

CSS provides three predefined border-width keywords: thin, medium, and thick.

thin

.thin-example {
  border-block-start: thin solid #1769aa;
}

Creates a thin border using a browser-defined width.

medium

.medium-example {
  border-block-start: medium solid #1769aa;
}

Creates a medium border. This is the initial border-width value.

thick

.thick-example {
  border-block-start: thick solid #1769aa;
}

Creates a thick border using a browser-defined width.

Comparing the Keywords

.panel-thin {
  border-block-start-width: thin;
}
.panel-medium {
  border-block-start-width: medium;
}
.panel-thick {
  border-block-start-width: thick;
}

The browser determines the exact pixel thicknesses. These keywords provide relative categories rather than fixed measurements.

Use explicit length values when precise border thickness is required.

Length Values

The property accepts nonnegative CSS lengths, including absolute and relative units.

Pixel Values

.pixel-border {
  border-block-start: 4px solid #1769aa;
}

Pixel values provide a convenient way to specify a consistent border thickness.

em Values

.em-border {
  font-size: 20px;
  border-block-start: 0.2em solid #1769aa;
}

The specified width is 4 pixels because 0.2em is calculated from the element's 20-pixel font size.

rem Values

.rem-border {
  border-block-start: 0.25rem solid #1769aa;
}

The width is relative to the root element's font size. With a 16-pixel root font size, 0.25rem equals 4 pixels.

Using calc()

.calculated-border {
  border-block-start-style: solid;
  border-block-start-color: #1769aa;
  border-block-start-width: calc(2px + 0.1rem);
}

The calc() function combines compatible length values to calculate the border thickness.

Using clamp()

.responsive-border {
  border-block-start: solid #1769aa;
  border-block-start-width: clamp(2px, 0.3vw, 6px);
}

The clamp() function limits the preferred width between 2 and 6 pixels.

Invalid Values

.invalid-negative {
  border-block-start-width: -3px;
}
.invalid-percentage {
  border-block-start-width: 10%;
}

Negative lengths and percentages are invalid. Browsers ignore these declarations.

Border Visibility

A specified border width does not guarantee that the border will appear. The border also needs a visible style and a color that can be distinguished from its background.

Width Without Style

.invisible {
  border-block-start-width: 5px;
  border-block-start-color: red;
}

The border remains invisible if its style is none.

Adding a Visible Style

.visible {
  border-block-start-width: 5px;
  border-block-start-style: solid;
  border-block-start-color: red;
}

The border becomes visible because its style is solid.

Zero Width

.zero-width {
  border-block-start-width: 0;
  border-block-start-style: solid;
  border-block-start-color: red;
}

A zero-width border occupies no thickness and is not visible.

Transparent Border

.transparent {
  border-block-start-width: 5px;
  border-block-start-style: solid;
  border-block-start-color: transparent;
}

The border occupies space but is not visibly painted.

none and hidden

.none-style {
  border-block-start: 5px none red;
}
.hidden-style {
  border-block-start: 5px hidden red;
}

Both styles produce a used border width of zero. The hidden style also has special precedence when resolving collapsed table border conflicts.

Logical border properties provide separate controls for width, style, and color on each logical side.

Property Purpose
border-block-start Sets the width, style, and color of the block-start border.
border-block-start-width Sets only the block-start border width.
border-block-start-style Sets only the block-start border style.
border-block-start-color Sets only the block-start border color.
border-block-end-width Sets the width of the opposite logical block border.
border-block-width Sets the widths of both logical block borders.
border-inline-width Sets the widths of both logical inline borders.

Different Widths on Both Block Sides

.panel {
  border-block: solid #1769aa;
  border-block-start-width: 6px;
  border-block-end-width: 2px;
}

The block-start border is 6 pixels wide, while the block-end border is 2 pixels wide.

Using border-block-width

.panel {
  border-block: solid #1769aa;
  border-block-width: 6px 2px;
}

The first value sets the block-start width, and the second sets the block-end width.

Logical vs. Physical Widths

.logical {
  border-block-start-width: 5px;
}
.physical {
  border-top-width: 5px;
}

In horizontal writing mode, both properties target the top border. In vertical writing, the logical property follows the block-start side, while the physical property always targets the top.

Shorthand and Longhand Interactions

Border shorthands can reset the logical block-start border width. The CSS cascade determines which declaration takes effect.

Overriding border-block-start

.panel {
  border-block-start: 2px solid #1769aa;
  border-block-start-width: 6px;
}

The later longhand increases the border width to 6 pixels.

Shorthand Reset

.panel {
  border-block-start-width: 6px;
  border-block-start: 2px solid #1769aa;
}

The later shorthand replaces the 6-pixel width with 2 pixels.

Overriding border-block-width

.panel {
  border-block: 3px solid #1769aa;
  border-block-width: 3px;
  border-block-start-width: 7px;
}

The block-start border becomes 7 pixels wide, while the block-end border remains 3 pixels wide.

The border Shorthand

.panel {
  border-block-start-width: 7px;
  border: 2px solid gray;
}

The later border shorthand sets all four physical border widths to 2 pixels, overriding the earlier logical width.

Cascade Priority

These examples assume equal origin, importance, specificity, and cascade layer priority. Higher-priority declarations can override later declarations.

For predictable results, establish general border styles first and apply specific logical border widths afterward.

Borders and the Box Model

The used block-start border width contributes to the element's dimensions according to its box-sizing value.

content-box

.content-box-panel {
  box-sizing: content-box;
  block-size: 150px;
  padding-block: 20px;
  border-block-start: 5px solid #1769aa;
}

The declared 150-pixel block size describes the content box. The block-axis padding adds 40 pixels, and the block-start border adds 5 pixels. With no block-end border, the border-box block size is 195 pixels.

border-box

.border-box-panel {
  box-sizing: border-box;
  block-size: 150px;
  padding-block: 20px;
  border-block-start: 5px solid #1769aa;
}

The declared 150-pixel block size includes the content, block-axis padding, and borders.

Avoiding Hover Layout Changes

.interactive-panel {
  border-block-start: 4px solid transparent;
}
.interactive-panel:hover {
  border-block-start-color: #1769aa;
}

The transparent border reserves space before hover. Changing only its color avoids changing the border thickness.

Animating Border Width

.animated-panel {
  border-block-start: 2px solid #1769aa;
  transition: border-block-start-width 200ms ease;
}
.animated-panel:hover {
  border-block-start-width: 6px;
}
@media (prefers-reduced-motion: reduce) {
  .animated-panel {
    transition: none;
  }
}

The border width transitions between 2 and 6 pixels. Unlike a color-only transition, this may change the element's dimensions or the space available to its content.

Practical Uses

The property is useful for adjusting the thickness of logical section accents, dividers, and component borders.

Heading Accent

.section-heading {
  border-block-start: solid #1769aa;
  border-block-start-width: 4px;
  padding-block-start: 12px;
}

The heading receives a prominent border that follows the logical block-start side.

Subtle Section Divider

.content-section {
  border-block-start: solid #d0d7de;
  border-block-start-width: 1px;
  padding-block-start: 20px;
  margin-block-start: 20px;
}

A thin border separates content sections without creating a heavy visual divider.

Emphasized Panel

.summary-panel {
  border-block-start: solid #1769aa;
  border-block-start-width: 6px;
  padding-block-start: 16px;
}

A thicker border creates a stronger visual accent.

Custom Property

.themed-panel {
  --accent-width: 4px;
  border-block-start: solid #1769aa;
  border-block-start-width: var(--accent-width);
}

A custom property makes it easier to maintain consistent accent widths across related components.

border-block-start-width Example

The following example compares three block-start border widths in horizontal writing mode and demonstrates how a 7-pixel border maps to vertical writing modes.

<div class="border-block-start-width-demo">
  <div class="demo-box thin">2px Border</div>
  <div class="demo-box medium">5px Border</div>
  <div class="demo-box thick">8px Border</div>
  <div class="demo-box vertical-right">vertical-rl</div>
  <div class="demo-box vertical-left">vertical-lr</div>
</div>
.border-block-start-width-demo {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  gap: 16px;
}
.border-block-start-width-demo .demo-box {
  box-sizing: border-box;
  inline-size: 160px;
  block-size: 100px;
  padding: 15px;
  border-block-start-style: solid;
  border-block-start-color: #1769aa;
  background-color: #e8f2fb;
  color: #173b5e;
  font-weight: bold;
  text-align: center;
}
.border-block-start-width-demo .thin {
  border-block-start-width: 2px;
}
.border-block-start-width-demo .medium {
  border-block-start-width: 5px;
}
.border-block-start-width-demo .thick {
  border-block-start-width: 8px;
}
.border-block-start-width-demo .vertical-right {
  writing-mode: vertical-rl;
  border-block-start-width: 7px;
}
.border-block-start-width-demo .vertical-left {
  writing-mode: vertical-lr;
  border-block-start-width: 7px;
}
Browser Result
2px Border
5px Border
8px Border
vertical-rl
vertical-lr

The first three boxes show how increasing border-block-start-width changes the thickness of the top border from 2 to 8 pixels.

In vertical-rl, the 7-pixel block-start border appears on the right. In vertical-lr, it appears on the left.

The same logical property controls all five borders without requiring separate physical border-width declarations.

Important Considerations

Keep the following points in mind when using border-block-start-width:

  • Logical border width: The property controls the thickness of the block-start border.
  • Initial value: The default value is medium.
  • Inheritance: The property is not inherited.
  • Writing mode: The physical border affected depends on writing-mode.
  • Horizontal writing: The property normally controls the top border width.
  • Vertical writing: It controls the right border in vertical-rl and the left border in vertical-lr.
  • Width keywords: thin, medium, and thick use browser-defined thicknesses.
  • Length values: Nonnegative lengths such as px, em, and rem are supported.
  • Invalid values: Negative lengths and percentages are not accepted.
  • Zero width: A value of 0 removes the border's thickness.
  • Border style: A style of none or hidden produces a used border width of zero.
  • Border color: This property does not change the border color.
  • Single side: Only the logical block-start border width is affected.
  • Both block sides: Use border-block-width to set both logical block border widths.
  • Shorthand: Use border-block-start to set width, style, and color together.
  • Physical borders: Logical and physical border-width declarations may affect the same edge depending on writing mode.
  • Shorthand resets: Later border shorthands can override the logical border width.
  • Box model: The used border width contributes to the element's dimensions.
  • Animation: Border width can animate as a length, but changing it may affect layout.
  • Accessibility: Important states should not be communicated through border thickness alone.

Use border-block-start-width when a logical block-start border needs a different thickness without resetting its style or color.

Browser Support

The border-block-start-width property is widely supported in modern versions of Chrome, Edge, Firefox, Safari, and other major browsers.

The standard property does not require vendor prefixes. Support for newer CSS math functions used in width values may vary independently.

Standard Declaration

.panel {
  border-block-start-style: solid;
  border-block-start-color: #1769aa;
  border-block-start-width: 5px;
}

Physical Border Fallback

.panel {
  border-top: 5px solid #1769aa;
}
@supports (border-block-start-width: 5px) {
  .panel {
    border-top: 0;
    border-block-start: 5px solid #1769aa;
  }
}

This fallback assumes horizontal writing mode. Browsers supporting logical borders use the block-start border, while older browsers retain the physical top 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-start-width property is defined in the CSS Logical Properties and Values Module Level 1 specification.

CSS Logical Properties and Values Module Level 1

General border-width behavior is defined in the CSS Backgrounds and Borders Module Level 3 specification.

CSS Backgrounds and Borders Module Level 3