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.
Fundamentals
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.
Foundation
📝 Syntax
The border-block shorthand sets width, style, and color on both block sides:
That means the border width is medium, the style is none (invisible), and the color is currentColor, which matches the element’s text color.
Reference
💎 Property Values
The border-block shorthand accepts the same value types as the regular border property.
Value
Example
Meaning
border-width
border-block: 2px solid black;
Thickness using px, em, rem, thin, medium, or thick
border-style
border-block: 2px dashed black;
Line style such as solid, dotted, dashed, or none
border-color
border-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.
block-start + block-end
two values
First value for block-start, second value for block-end.
start | 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.
Scope
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 bottomVertical writing → left and right
Horizontal writing
block-start (top) and block-end (bottom)
Vertical writing (vertical-rl)
block-start and block-end
Compare
border-block vs border-top / border-bottom
Property
Targets
Best for
border-block
Block-start and block-end (logical sides)
International layouts and writing-mode-aware components
border-top + border-bottom
Physical top and bottom edges
Simple pages that always use horizontal writing
border-inline
Inline-start and inline-end (logical sides)
Logical left/right borders in adaptive layouts
Preview
👀 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.
Hands-On
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>
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.
Compatibility
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 ExplorerNo support · Use physical border properties instead
None
border-block property96% supported
Bottom line: Use border-block confidently in modern projects, especially with logical layout properties.
Wrap Up
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.
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
Summary
Key Takeaways
Knowledge Unlocked
Five things to remember about border-block
Use these points when styling logical block borders.
5
Core concepts
▦️01
Logical Shorthand
Block-start + block-end.
Purpose
📝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.