CSS border-block-width Property

Beginner
⏱️ 5 min read
📚 Updated: Jun 2026
🎯 4 Examples
Logical CSS & Borders

What You’ll Learn

The border-block-width property sets how thick the block-start and block-end borders are on an element. In horizontal writing, that usually means the top and bottom border widths.

01

Block Widths

Start and end edges.

02

One Value

Same on both sides.

03

Two Values

Start vs end width.

04

thin / medium / thick

Keyword sizes.

05

px / em / rem

Exact length units.

06

Writing Modes

Adapts to text flow.

Definition and Usage

The border-block-width property is a shorthand that sets the width of the borders on the block-start and block-end sides of an element. In horizontal writing, block usually refers to the top and bottom borders.

This property is part of CSS Logical Properties. You can use one value for both sides or two values when block-start and block-end need different thicknesses.

💡
Beginner Tip

border-block-width only sets thickness. Add border-block-style: solid; and border-block-color: black; so the border is visible, or use border-block: 5px solid black; as shorthand.

📝 Syntax

The syntax for border-block-width accepts one or two keyword or length values:

syntax.css
selector {
  border-block-width: <length> | thin | medium | thick | <length> <length>;
}

Basic Example

border-block-width.css
div {
  border-block-width: 5px 10px;
  border-block-style: solid;
  border-block-color: blue;
}

The value can be a keyword such as thin or a length such as 5px, 0.25em, or 1rem.

Syntax Rules

  • One value applies the same width to block-start and block-end.
  • Two values set block-start first, then block-end.
  • The initial value is medium, typically around 3 pixels.
  • Keywords: thin, medium, and thick.
  • Length values use units like px, em, or rem.
  • Pair with border-block-style and border-block-color for full control.
  • Related longhands: border-block-start-width and border-block-end-width.

⚡ Quick Reference

QuestionAnswer
Initial valuemedium
Applies toBlock-start and block-end border widths
InheritedNo
AnimatableYes, as a length
Common useSection dividers, cards, emphasis borders, writing-mode-aware layouts

Default Value

The default value of border-block-width is medium, which typically corresponds to a width of around 3 to 4 pixels depending on the browser’s default settings.

💎 Property Values

The border-block-width property accepts keyword values and length units.

ValueDescription
thinA thin border width (typically 1px)
mediumA medium border width (default, typically 3–4px)
thickA thick border width (typically 5–6px)
<length>A specific width using a length unit like px, em, or rem
initialSets the property to its default value
inheritInherits the property value from its parent element
previewthin
previewmedium
previewthick
preview1px
preview4px
preview8px

Block Width and Writing Modes

Block-start and block-end follow the block axis, so the same width rule adapts when writing mode changes.

Horizontal writing

5px block-start and block-end border widths

Vertical writing (vertical-rl)

Logical block border widths

border-block-width vs border-top-width / border-bottom-width

PropertyTargetsBest for
border-block-widthLogical block-start and block-end border thicknessMultilingual and writing-mode-aware layouts
border-top-width / border-bottom-widthPhysical top and bottom border thicknessSimple horizontal pages with fixed top and bottom borders
border-blockWidth, style, and color together on both block sidesWhen you want one shorthand for full block borders

👀 Live Preview

A box with 5px block-start and block-end border widths:

This element has a 5px block border width on both block sides.

Uses border-block-width: 5px; with solid style and dark color.

Examples Gallery

Try border-block-width with two-value lengths, one value, keyword sizes, and vertical writing mode.

📚 Basic Block Widths

Set block-start and block-end border widths with style and color longhands so the lines are visible.

Example 1 — Different Block-Start and Block-End Widths

Set different border widths for the block-start and block-end edges of a div element.

border-block-width-two-value.html
<style>
  div {
    border-block-width: 5px 10px;
    border-block-style: solid;
    border-block-color: blue;
    padding-block: 0.75rem;
  }
</style>

<div>
  This div has a 5px block-start border and a 10px block-end border.
</div>
Try It Yourself

How It Works

With two values, the first width applies to block-start and the second to block-end. Style and color longhands make both borders visible.

Example 2 — Same Width on Both Block Sides

Use one value to apply the same border width to block-start and block-end.

border-block-width-same.css
.card {
  border-block-width: 4px;
  border-block-style: solid;
  border-block-color: #64748b;
  padding-block: 1rem;
}
Try It Yourself

How It Works

One value repeats on both logical block edges, which is useful for symmetric top-and-bottom borders in horizontal writing.

📏 Keywords and Writing Modes

Compare keyword widths and see how block border thickness adapts in vertical writing mode.

Example 3 — thin, medium, and thick Keywords

Compare keyword border widths on the block axis.

border-block-width-keywords.css
.thin {
  border-block: thin solid #64748b;
}
.medium {
  border-block-width: medium;
  border-block-style: solid;
  border-block-color: #2563eb;
}
.thick {
  border-block: thick solid #dc2626;
}
Try It Yourself

How It Works

Keywords give quick sizing without exact pixels. medium is the initial default value.

Example 4 — Block Width in Vertical Writing Mode

See how block border widths follow the block axis in vertical text.

border-block-width-vertical.css
.vertical-panel {
  writing-mode: vertical-rl;
  border-block-width: 6px;
  border-block-style: solid;
  border-block-color: #7c3aed;
  padding: 1rem;
}
Try It Yourself

How It Works

With vertical writing, block-start and block-end move with the block axis. The same width values still apply to the correct logical edges.

🧠 How border-block-width Works

1

You choose a thickness

Set a keyword like thin or a length like 5px.

Width rule
2

You add style and color

Pair the width with border-block-style and border-block-color.

Border setup
3

The browser draws both block sides

Block-start and block-end use your width values based on the current writing mode.

Logical mapping
=

Sized block borders

Your element gets clear separators with the thickness you chose on both logical block edges.

Universal Browser Support

border-block-width is supported in all modern browsers. Internet Explorer does not support logical border properties.

Baseline · Modern browsers

Logical border widths in today’s browsers

Chrome, Firefox, Safari, Edge, and Opera support border-block-width in current versions.

96% Modern browser support
Google Chrome69+ · Desktop & Mobile
Full support
Mozilla Firefox66+ · Desktop & Mobile
Full support
Apple Safari12.1+ · macOS & iOS
Full support
Microsoft Edge79+ · Chromium
Full support
Opera56+ · Modern versions
Full support

Fallback behavior

For older browsers, use border-top-width and border-bottom-width as physical fallbacks in horizontal layouts.

💻
Internet Explorer No support · Use border-top-width and border-bottom-width instead
None
border-block-width property 96% supported

Bottom line: Use border-block-width confidently in modern logical layout systems.

Conclusion

The border-block-width property is a powerful tool for controlling border thickness on block-start and block-end sides, especially when content flow may change across languages or writing modes. By using logical properties like this, you can create responsive and adaptable designs that work across various languages and writing directions.

💡 Best Practices

✅ Do

  • Use one value for matching block-start and block-end widths
  • Pair width with style and color longhands for predictable results
  • Use rem when you want thickness to scale with root font size
  • Use the border-block shorthand when setting all three parts
  • Test block border widths in vertical writing mode when needed

❌ Don’t

  • Set width alone and forget a visible border style
  • Assume block-start always equals physical top
  • Use very thick borders everywhere in minimal UI designs
  • Mix physical and logical width properties without a reason
  • Rely on medium when you need exact pixel control

Key Takeaways

Knowledge Unlocked

Five things to remember about border-block-width

Use these points when sizing logical block borders on both sides.

5
Core concepts
⚙️02

medium Default

Browser default size.

Default
📏03

thin / thick

Quick keywords.

Values
📝04

px / em / rem

Exact lengths.

Units
🔄05

Writing Mode

Adapts to flow.

Context

❓ Frequently Asked Questions

The border-block-width property sets the thickness of borders on the block-start and block-end sides of an element. In horizontal writing, those are usually the top and bottom border widths.
The initial value is medium, which is typically around 3 pixels depending on the browser.
Yes. With one value, both block-start and block-end use the same width. With two values, the first applies to block-start and the second to block-end.
Width alone does not always show a border. You also need a visible border-block-style such as solid and usually border-block-color, or use the border-block shorthand.
Physical top and bottom width properties always target fixed edges. border-block-width follows the writing mode and stays on the logical block-start and block-end sides.

Practice in the Live Editor

Open the HTML editor, try border-block-width, and preview logical block borders instantly.

HTML Editor →

About the author

Mari Selvan M P
Mari Selvan M P 🔗

Developer, cloud engineer, and technical writer

  • Experience 12 years building web and cloud systems
  • Focus Full Stack Development, AWS, and Developer Education

I write practical tutorials so students and working developers can learn by doing—from databases and APIs to deployment on AWS.

5 people found this page helpful