CSS border-block Property

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

What You’ll Learn

The border-block property is a logical CSS shorthand for styling the block-start and block-end borders of an element. In normal horizontal English layouts, that usually means the top and bottom borders.

01

Logical Borders

Block-start and block-end.

02

Shorthand

Width, style, color.

03

One Value

Same border both sides.

04

Two Values

Different start and end.

05

Writing Modes

Adapts to text flow.

06

vs border-top

Physical vs logical.

Definition and Usage

The border-block CSS property is a shorthand for setting border width, border style, and border color on the block-start and block-end sides of an element. In a typical English layout, block-start is the top edge and block-end is the bottom edge.

In vertical writing modes or other languages with different writing directions, those physical positions can change. border-block adapts automatically, which makes it useful for responsive and international layouts.

💡
Beginner Tip

For a simple horizontal page, border-block: 4px solid blue; looks like top and bottom blue borders. The advantage appears when writing mode changes and physical top/bottom rules would no longer be correct.

📝 Syntax

The border-block shorthand sets width, style, and color on both block sides:

syntax.css
selector {
  border-block: <border-width> <border-style> <border-color>;
}

Basic Example

border-block.css
div {
  border-block: 4px solid blue;
}

Syntax Rules

  • One value applies the same border to both block-start and block-end.
  • border-block-width, border-block-style, and border-block-color each accept one or two values for start and end.
  • Use border-block-start and border-block-end when each side needs a different full border.
  • Values follow the usual border order: width, style, then color.
  • Related properties include border-block-start, border-block-end, and border-inline.
  • A border only appears when the style is not none.

⚡ Quick Reference

QuestionAnswer
Initial valuemedium none currentColor
Applies toBlock-start and block-end border sides
InheritedNo
AnimatablePartially (color and width in supporting browsers)
Common useSection dividers, headers, writing-mode-aware layouts

Default Value

The default value for border-block is:

default.css
border-block: medium none currentColor;

That means the border width is medium, the style is none (invisible), and the color is currentColor, which matches the element’s text color.

💎 Property Values

The border-block shorthand accepts the same value types as the regular border property.

ValueExampleMeaning
border-widthborder-block: 2px solid black;Thickness using px, em, rem, thin, medium, or thick
border-styleborder-block: 2px dashed black;Line style such as solid, dotted, dashed, or none
border-colorborder-block: 2px solid #ff5733;Any valid CSS color value

One Value vs Two Values

one value

Applies the same border to both block-start and block-end.

two values

First value for block-start, second value for block-end.

  • One value — Applies the same border to both block-start and block-end.
  • Two values on longhands — On border-block-width, border-block-style, or border-block-color, the first value applies to block-start and the second to block-end.
  • Side shorthands — Use border-block-start and border-block-end for fully different borders on each side.

Block Borders and Writing Modes

border-block targets the sides along the block axis, so the same rule behaves correctly in different writing modes.

Horizontal writing → top and bottom Vertical writing → left and right

Horizontal writing

block-start (top) and block-end (bottom)

Vertical writing (vertical-rl)

block-start and block-end

border-block vs border-top / border-bottom

PropertyTargetsBest for
border-blockBlock-start and block-end (logical sides)International layouts and writing-mode-aware components
border-top + border-bottomPhysical top and bottom edgesSimple pages that always use horizontal writing
border-inlineInline-start and inline-end (logical sides)Logical left/right borders in adaptive layouts

👀 Live Preview

A box with matching borders on block-start and block-end:

This element has blue borders on block-start and block-end.

In horizontal writing, border-block: 4px solid #2563eb; appears on the top and bottom.

Examples Gallery

Try border-block with matching borders, split start/end values, section dividers, and vertical writing mode.

📚 Basic border-block

Apply the same border to both block-start and block-end with one shorthand value.

Example 1 — Solid Blue Block Borders

Apply a 4px solid blue border to both block-start and block-end sides of a div.

border-block-basic.html
<style>
  div {
    border-block: 4px solid blue;
    padding: 1rem;
  }
</style>

<div>
  This element has a blue border on the block-start and block-end sides.
</div>
Try It Yourself

How It Works

One shorthand rule styles both block edges. In horizontal writing, you see blue lines on the top and bottom of the box.

Example 2 — Different block-start and block-end Borders

Style block-start and block-end differently with side shorthands or two-value longhands.

border-block-split.css
.panel {
  border-block-start: 3px solid #2563eb;
  border-block-end: 1px solid #cbd5e1;
  padding: 1rem;
}
Try It Yourself

How It Works

border-block-start styles the block-start edge and border-block-end styles the block-end edge. This is useful when one side needs stronger emphasis.

🎨 Layout Patterns

Use logical block borders for section dividers and writing-mode-aware components.

Example 3 — Section Divider

Create a content section with strong block borders to separate it from surrounding content.

border-block-section.css
.section {
  border-block: 2px solid #059669;
  padding-block: 1.25rem;
  background: #ecfdf5;
}
Try It Yourself

How It Works

Pairing border-block with padding-block creates a balanced section with logical spacing and borders.

Example 4 — border-block in Vertical Writing Mode

See how block borders follow the writing mode instead of staying on physical top and bottom edges.

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

How It Works

With vertical writing, block-start and block-end move to the sides of the element. border-block still targets the correct logical edges.

🧠 How border-block Works

1

The browser finds block-start and block-end

Writing mode decides which physical edges are block-start and block-end.

Writing mode
2

You set one or two border values

Write border-block: 4px solid blue; or provide separate start and end values.

CSS rule
3

Borders render on logical block sides

The shorthand expands to block-start and block-end border properties behind the scenes.

Rendering
=

Adaptable block borders

Your layout keeps the correct border placement when writing mode changes.

Universal Browser Support

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

Baseline · Modern browsers

Logical borders in today’s browsers

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

96% Modern browser support
Google Chrome69+ · Desktop & Mobile
Full support
Mozilla Firefox41+ · 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 physical properties such as border-top and border-bottom as a fallback.

💻
Internet Explorer No support · Use physical border properties instead
None
border-block property 96% supported

Bottom line: Use border-block confidently in modern projects, especially with logical layout properties.

Conclusion

The border-block property is a useful shorthand for styling borders on the block-start and block-end sides of an element. It simplifies top-and-bottom border styling while staying correct in different writing modes.

By mastering border-block, you can build flexible, responsive border designs that work well in international layouts and pair naturally with other logical CSS properties.

💡 Best Practices

✅ Do

  • Use border-block with logical spacing like padding-block
  • Prefer one value when both block edges should match
  • Use two values when block-start needs stronger emphasis
  • Test layouts in vertical writing mode when targeting global audiences
  • Pair with border-inline for full logical border control

❌ Don’t

  • Mix physical and logical borders on the same component without reason
  • Assume block-start always means top in every layout
  • Forget that border-style must not be none for visibility
  • Use logical borders without a fallback for very old browsers if required
  • Replace every simple border-top with border-block on basic pages

Key Takeaways

Knowledge Unlocked

Five things to remember about border-block

Use these points when styling logical block borders.

5
Core concepts
📝02

One or Two Values

Same or split borders.

Syntax
🔄03

Writing Mode

Adapts to text flow.

Context
📏04

Width Style Color

Standard border parts.

Values
🌐05

Modern CSS

Better than top/bottom alone.

Layout

❓ Frequently Asked Questions

The border-block property is a shorthand that sets border width, style, and color on the block-start and block-end sides of an element. In horizontal writing, those are usually the top and bottom borders.
The initial value is medium none currentColor, which means no visible border is drawn until you set a border style other than none.
border-top and border-bottom always target physical top and bottom edges. border-block follows the writing mode, so it stays correct when text direction or writing mode changes.
Yes. With two values, the first applies to block-start and the second to block-end. With one value, both sides use the same border.
Use border-block when building layouts that may use vertical writing modes, multilingual content, or logical CSS systems that pair with properties like inline-size and block-size.

Practice in the Live Editor

Open the HTML editor, try border-block, and preview logical 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