CSS border-block-color Property

Beginner
5 min read
Updated: Oct 2026
3 examples
Live preview

Definition and Usage

The border-block-color property sets the color of an element’s logical block-start and block-end borders. In the default horizontal writing mode, that means the top and bottom border colors.

One color paints both sides. Two colors set start first and end second. It maps to physical sides based on writing-mode. For the other axis, use border-inline-color.

Baseline · Widely available.

Not deprecated and not experimental. Logical border color properties have been widely available across browsers since 2021.

CSS Syntax

syntax.css
border-block-color: <color> | <color> <color> | initial | inherit;

The initial value is currentColor. You still need a visible border-block-style and width for the color to show.

Property Values

ValueDescriptionTry it
<color>One color for both block sidesTry it
<color> <color>First = block-start, second = block-endTry it
currentColorUses the element’s text color. Initial valueTry it
transparentInvisible border color; width still takes spaceTry it
With writing-modePhysical edges change when writing mode is verticalTry it
initialResets to currentColorTry it
inheritInherits this property from the parent elementTry it

How to Use border-block-color

Give the block borders a style and width first, then set their color.

  1. Set a visible block border, for example border-block: 4px solid; or separate width and style.
  2. Add border-block-color with one color for both sides, or two colors for start and end.
  3. Leave the inline sides alone, or color them with border-inline-color.
  4. Remember: without a style other than none, the color will not show.
PieceRequired?Role
Border styleYes (to show a line)solid, dashed, and so on
Border widthYes (to see color)Zero width hides the color
One or two colorsYesOne = both sides; two = start then end
writing-modeOptionalChanges which physical edges get the colors

Live Preview

The box already has a solid 4px block border. Change only border-block-color.

Two values color block-start first and block-end second. Style and width stay fixed.

Box

border-block-color: #2563eb

CSS Examples

Each snippet focuses on border-block-color. Style and width are only there so the color can show. Use Try It Yourself for a live editor.

Example 1 — One Color on Both Sides

Paint block-start and block-end with the same blue.

CSS
<style>
  div {
    border-block: 4px solid;
    border-block-color: #2563eb;
    padding: 12px;
  }
</style>

<div>Same color on both block sides</div>
Try It Yourself

How It Works

  1. Draw the block borders. border-block: 4px solid sets width and style on both block sides.
  2. Set one color. border-block-color: #2563eb paints start and end the same.
  3. Leave inline sides alone. Left and right stay without a border in this snippet.
  4. Map to physical edges. In horizontal text, you see blue on top and bottom.

Example 2 — Two Different Colors

First color is block-start. Second color is block-end.

CSS
<style>
  div {
    border-block: 4px solid;
    border-block-color: #2563eb #0f766e;
    padding: 12px;
  }
</style>

<div>Blue start, teal end</div>
Try It Yourself

How It Works

  1. Keep a visible border. Width and style still come from border-block.
  2. Pass two colors. The first value colors block-start.
  3. Second value colors block-end. Here that is teal on the bottom in horizontal text.
  4. Same property, two jobs. You do not need separate start/end color longhands for this pattern.

Example 3 — currentColor

Let the border follow the text color.

CSS
<style>
  div {
    color: #7c3aed;
    border-block: 4px solid;
    border-block-color: currentColor;
    padding: 12px;
  }
</style>

<div>Border matches text color</div>
Try It Yourself

How It Works

  1. Set the text color. color: #7c3aed is what currentColor reads.
  2. Draw the block borders. Style and width are still required.
  3. Point color at the text. border-block-color: currentColor copies that purple.
  4. Initial behavior. If you omit border-block-color, browsers already use currentColor by default.

Edge Cases & Pitfalls

If the color seems missing, check these first.

style

Color needs a visible style

border-block-color alone never draws a line. Add border-block-style (or a border-block shorthand with a style).

width

Zero width hides the color

A border with 0 width has nowhere to show the color. Set a positive border-block-width.

order

Two values are start then end

border-block-color: blue green means blue on block-start and green on block-end. Swap them if the wrong edge looks wrong.

shorthand

border-block can overwrite color

Writing border-block: 4px solid red after your color rule replaces it. Put border-block-color after the shorthand, or include the color in the shorthand.

axis

Inline sides need another property

This property never colors left/right in horizontal text. Use border-inline-color for the inline axis.

Browser Support

border-block-color is a browser CSS property for logical border colors. Node.js, Deno, and Bun do not apply it.

✓ Baseline · Widely available

border-block-color

Chrome 87+, Edge 87+, Firefox 66+, Safari 14.1+. Internet Explorer has no support.

97% Modern browser support
Google Chrome 87+
Full support
Mozilla Firefox 66+
Full support
Apple Safari 14.1+
Full support
Microsoft Edge 87+
Full support
Opera 73+
Full support
Samsung Internet 14+
Full support
Internet Explorer No support
Not supported
border-block-color Widely supported

Bottom line: Safe for modern browsers. Fall back to border-top-color and border-bottom-color only when you must support Internet Explorer. It is not a runtime API.

Key Takeaways

  • Role: color the logical block-start and block-end borders.
  • One or two colors: one for both sides; two for start then end.
  • Needs a line: style and width must exist before color is visible.
  • Initial value: currentColor. Not inherited. Follows writing mode.

One line: visible block border + border-block-color: blue green; = colored start and end on the block axis.

Frequently Asked Questions

It 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 both block borders.
Yes. One color paints both sides. Two colors set block-start first and block-end second, for example border-block-color: blue green.
Color alone does not draw a border. You also need a visible style such as solid and a width greater than zero.
border-color targets physical sides. border-block-color targets only the logical block axis and follows writing-mode.
It is Baseline Widely available. Chrome 87+, Edge 87+, Firefox 66+, and Safari 14.1+ support it. Internet Explorer does not. It is a browser CSS property, not a Node.js feature.

Next: border-block-end

Set width, style, and color on only the block-end edge.

border-block-end tutorial →

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.

8 people found this page helpful