CSS border-block-color Property

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

What You’ll Learn

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.

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.

📝 Syntax

The syntax for border-block-color accepts one or two color values:

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

Basic Example

border-block-color.css
.block {
  border-style: solid;
  border-width: 4px;
  border-block-color: blue green;
}

Syntax Rules

  • Single color value — Applies the same color to both block-start and block-end.
  • Two color values — The first sets block-start; the second sets block-end.
  • In horizontal writing, block-start is usually top and block-end is usually bottom.
  • Use with a visible border-style and non-zero border-width.
  • Related properties include border-block-width, border-block-style, and border-block.

⚡ Quick Reference

QuestionAnswer
Initial valuecurrentColor
Applies toBlock-start and block-end border colors
InheritedNo
AnimatableYes, as a color
Common useSection dividers, cards, writing-mode-aware borders

Default Value

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.

💎 Property Values

border-block-color accepts any valid CSS color value.

ValueExampleMeaning
Named colorborder-block-color: blue;Uses a CSS color keyword such as red or blue
Hexadecimalborder-block-color: #ff5733;Uses a hex color code
RGBborder-block-color: rgb(0, 0, 0);Uses an RGB color function
HSLborder-block-color: hsl(0, 0%, 0%);Uses an HSL color function
currentColorborder-block-color: currentColor;Uses the element’s current text color
blue #ff5733 rgb() hsl()
blue

One color applies to both block-start and block-end.

blue green

Two colors: first for block-start, second for block-end.

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

border-block-color vs border-color

PropertyTargetsBest for
border-block-colorBlock-start and block-end onlyLogical layouts and writing-mode-aware designs
border-colorAll four physical sidesSimple boxes with the same color on every edge
border-top-color + border-bottom-colorPhysical top and bottom onlyBasic horizontal pages without writing-mode changes

👀 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;.

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>

<div class="block">
  This block has a blue top border and a green bottom border.
</div>
Try It Yourself

How It Works

The first color styles block-start and the second styles block-end. In horizontal writing, you see blue on top and green on bottom.

Example 2 — Same Color on Both Block Sides

Use one color value when block-start and block-end should match.

border-block-color-single.css
.card {
  border-block: 2px solid #2563eb;
  border-block-color: #2563eb;
  padding: 1rem;
}
Try It Yourself

How It Works

One color value applies to both logical block sides. This is the most common pattern for uniform section borders.

🎨 Color Formats

Use named colors, hex codes, rgb(), hsl(), or currentColor with border-block-color.

Example 3 — Hex Color Block Borders

Apply a brand color using a hexadecimal value on both block borders.

border-block-color-hex.css
.highlight {
  border-style: solid;
  border-width: 3px 0;
  border-block-color: #ff5733;
  padding-block: 1rem;
}
Try It Yourself

How It Works

border-width: 3px 0; limits visible borders mostly to the block axis, and border-block-color tints those edges orange.

Example 4 — border-block-color in Vertical Writing Mode

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

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

How It Works

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.

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 Explorer No support · Use physical border color properties instead
None
border-block-color property 96% supported

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

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.

💡 Best Practices

✅ Do

  • 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

Key Takeaways

Knowledge Unlocked

Five things to remember about border-block-color

Use these points when coloring logical block borders.

5
Core concepts
📝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.

Practice in the Live Editor

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