The border-block-color property sets the color of logical block borders on an element. In horizontal writing, that usually means the top and bottom border colors.
01
Block Colors
Start and end borders.
02
One Color
Same on both sides.
03
Two Colors
Split start and end.
04
Color Formats
Named, hex, rgb, hsl.
05
currentColor
Matches text color.
06
Writing Modes
Adapts to text flow.
Fundamentals
Definition and Usage
The border-block-color CSS property sets the color of the logical block borders of an element. Logical block borders refer to the block-start and block-end sides, which are typically the top and bottom borders in horizontal writing modes.
This property is especially useful in writing modes where text flow can change, such as vertical or right-to-left layouts. It lets you color block-axis borders without hard-coding top and bottom.
💡
Beginner Tip
border-block-color only controls color. Pair it with border-style and border-width (or border-block) so the borders are actually visible.
Foundation
📝 Syntax
The syntax for border-block-color accepts one or two color values:
The default value of border-block-color is currentColor. That means the block border color inherits the element’s text color value unless you override it.
Reference
💎 Property Values
border-block-color accepts any valid CSS color value.
Value
Example
Meaning
Named color
border-block-color: blue;
Uses a CSS color keyword such as red or blue
Hexadecimal
border-block-color: #ff5733;
Uses a hex color code
RGB
border-block-color: rgb(0, 0, 0);
Uses an RGB color function
HSL
border-block-color: hsl(0, 0%, 0%);
Uses an HSL color function
currentColor
border-block-color: currentColor;
Uses the element’s current text color
blue#ff5733rgb()hsl()
blue
One color applies to both block-start and block-end.
Same color both sides
blue green
Two colors: first for block-start, second for block-end.
Start blue, end green
Scope
Block Border Colors and Writing Modes
Logical block border colors follow the block axis, so they stay correct when writing mode changes.
Horizontal writing
Purple top, orange bottom
Vertical writing (vertical-rl)
Logical block colors
Compare
border-block-color vs border-color
Property
Targets
Best for
border-block-color
Block-start and block-end only
Logical layouts and writing-mode-aware designs
border-color
All four physical sides
Simple boxes with the same color on every edge
border-top-color + border-bottom-color
Physical top and bottom only
Basic horizontal pages without writing-mode changes
Preview
👀 Live Preview
A box with blue block-start and green block-end border colors:
Blue block-start border, green block-end border
Uses border-style: solid;, border-width: 4px;, and border-block-color: #2563eb #059669;.
Hands-On
Examples Gallery
Try border-block-color with split colors, a single color, hex values, and vertical writing mode.
📚 Block Border Colors
Set logical block border colors after defining a visible border style and width.
Example 1 — Blue and Green Block Borders
Set block-start to blue and block-end to green using two color values.
border-block-color-split.html
<style>.block{border-style:solid;border-width:4px;border-block-color:blue green;padding:1rem;}</style><divclass="block">
This block has a blue top border and a green bottom border.
</div>
With vertical writing, block-start and block-end move to the sides. The same color rule still targets the correct logical edges.
🧠 How border-block-color Works
1
You define a visible border
Set border-style and border-width so borders can be drawn.
Border setup
2
You choose one or two colors
Write border-block-color: blue green; or a single shared color.
Color rule
3
Colors map to logical block sides
The browser applies colors to block-start and block-end based on writing mode.
Logical mapping
=
🎨
Distinct block border colors
Your element gets readable, adaptable color accents on the block axis.
Compatibility
Universal Browser Support
border-block-color is supported in all modern browsers. Internet Explorer does not support logical border properties.
✓ Baseline · Modern browsers
Logical border colors in today’s browsers
Chrome, Firefox, Safari, Edge, and Opera support border-block-color 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-color and border-bottom-color as physical fallbacks.
💻
Internet ExplorerNo support · Use physical border color properties instead
None
border-block-color property96% supported
Bottom line: Use border-block-color confidently in modern projects with logical layout properties.
Wrap Up
Conclusion
The border-block-color property provides a convenient way to control the color of an element’s logical block borders. It is especially useful when text flow or writing mode may change across layouts or languages.
Experiment with single colors, split start/end colors, and different color formats to create visually distinct designs that remain adaptable in modern CSS layouts.
Pair border-block-color with visible border style and width
Use two colors when block-start and block-end need different emphasis
Prefer hex or CSS variables for brand-consistent border colors
Test colors in vertical writing mode for international layouts
Combine with border-block when you need full shorthand control
❌ Don’t
Expect colors to show without a non-none border style
Assume block-start always means physical top in every layout
Use very low-contrast border colors on important UI elements
Mix logical and physical color properties without a clear reason
Forget fallbacks only when older browser support is required
Summary
Key Takeaways
Knowledge Unlocked
Five things to remember about border-block-color
Use these points when coloring logical block borders.
5
Core concepts
🎨01
Logical Colors
Block-start + block-end.
Purpose
📝02
One or Two Values
Same or split colors.
Syntax
⚡03
currentColor
Default text color.
Default
🖼️04
Any Color Format
Named, hex, rgb, hsl.
Values
🔄05
Needs Style
Pair with border-style.
Setup
❓ Frequently Asked Questions
The border-block-color property sets the color of the logical block-start and block-end borders. In horizontal writing, those are usually the top and bottom border colors.
The initial value is currentColor, which uses the element's text color for the block borders.
Yes. With two color values, the first applies to block-start and the second to block-end. With one value, both sides use the same color.
border-block-color only sets color. You also need a visible border style such as solid and a border width greater than zero.
border-color sets colors on all four physical sides. border-block-color targets only the logical block axis sides and adapts when writing mode changes.