CSS border-block-start-color Property

The border-block-start-color property sets the color of an element's logical block-start border.

The physical border affected depends on the element's writing mode. In horizontal writing, it controls the top border color. In vertical writing, it controls the left or right border color. The property changes only the color, leaving the specified border width and style unchanged.

border-block-start-color Syntax

selector {
  border-block-start-color: #1769aa;
}

The property accepts a single CSS color value or a CSS-wide keyword.

.named-color {
  border-block-start-color: blue;
}
.hex-color {
  border-block-start-color: #1769aa;
}
.rgb-color {
  border-block-start-color: rgb(23 105 170);
}
.hsl-color {
  border-block-start-color: hsl(207 76% 38%);
}
.current-color {
  border-block-start-color: currentColor;
}
.transparent-color {
  border-block-start-color: transparent;
}

CSS-wide keywords are also supported:

.inherited {
  border-block-start-color: inherit;
}
.reset {
  border-block-start-color: initial;
}
.unset {
  border-block-start-color: unset;
}
.reverted {
  border-block-start-color: revert;
}
.layer-reverted {
  border-block-start-color: revert-layer;
}

Only one color value is accepted. To set both logical block border colors, use border-block-color.

Property Values

Value Description
<color> Any supported CSS color value, including named colors, hexadecimal colors, and color functions.
currentColor Uses the element's computed color value. This is the initial value.
transparent Sets a fully transparent border color.
inherit Uses the parent's computed block-start border color.
initial Resets the property to currentColor.
unset Resets the property to its initial value because it is not inherited.
revert Reverts the property according to CSS cascade origin rules.
revert-layer Reverts the property according to CSS cascade layer rules.

The initial value is currentColor. The property is not inherited, and its animation type is a color.

Although the border color is not inherited by default, currentColor can make it follow an inherited text color.

How It Works

The border-block-start-color property controls the color of one logical border. It does not establish the border's width or style.

Setting a Visible Border

.panel {
  border-block-start-width: 4px;
  border-block-start-style: solid;
  border-block-start-color: #1769aa;
}

This creates a 4-pixel solid blue border on the logical block-start side.

Changing an Existing Border Color

.panel {
  border-block-start: 4px solid #1769aa;
  border-block-start-color: #d35400;
}

The second declaration changes the border color to orange without changing its width or style.

Changing Only One Block Side

.panel {
  border-block: 3px solid #1769aa;
  border-block-start-color: #d35400;
}

The block-start border becomes orange, while the block-end border remains blue.

Color Without a Border Style

.panel {
  border-block-start-color: red;
}

The border remains invisible if its style is none. Setting a color alone does not create a visible border.

Writing Modes and Border Mapping

Logical border properties follow the block axis established by writing-mode.

Writing Mode Physical Block-Start Border
horizontal-tb Top
vertical-rl Right
vertical-lr Left
sideways-rl Right
sideways-lr Left

Horizontal Writing

.horizontal {
  writing-mode: horizontal-tb;
  border-block-start: 4px solid;
  border-block-start-color: #1769aa;
}

The blue border appears along the top edge.

Vertical Right-to-Left Writing

.vertical-right {
  writing-mode: vertical-rl;
  border-block-start: 4px solid;
  border-block-start-color: #1769aa;
}

The blue border appears along the right edge.

Vertical Left-to-Right Writing

.vertical-left {
  writing-mode: vertical-lr;
  border-block-start: 4px solid;
  border-block-start-color: #1769aa;
}

The blue border appears along the left edge.

Text Direction

.rtl-panel {
  direction: rtl;
  writing-mode: horizontal-tb;
  border-block-start: 4px solid;
  border-block-start-color: #1769aa;
}

Changing direction alone does not move the block-start border in horizontal writing mode. It remains at the top.

Supported Color Formats

The property accepts the same CSS color formats used by other color-related properties.

Named Colors

.named {
  border-block-start-color: navy;
}

Named colors use predefined CSS color keywords.

Hexadecimal Colors

.hex {
  border-block-start-color: #1769aa;
}

Hexadecimal notation specifies color channels using hexadecimal digits.

RGB Colors

.rgb {
  border-block-start-color: rgb(23 105 170);
}

The rgb() function defines a color using red, green, and blue channels.

HSL Colors

.hsl {
  border-block-start-color: hsl(207 76% 38%);
}

The hsl() function defines a color using hue, saturation, and lightness.

HWB Colors

.hwb {
  border-block-start-color: hwb(207 9% 33%);
}

The hwb() function defines a color using hue, whiteness, and blackness.

LAB Colors

.lab {
  border-block-start-color: lab(50% 5 -40);
}

The lab() function provides a perceptually oriented color representation.

OKLCH Colors

.oklch {
  border-block-start-color: oklch(60% 0.15 240);
}

The oklch() function defines a color using lightness, chroma, and hue.

Using color-mix()

.mixed {
  border-block-start-color: color-mix(in srgb, #1769aa 70%, white);
}

The color-mix() function blends colors to produce a new border color.

Modern CSS color functions may have compatibility requirements separate from the border-block-start-color property itself.

Using currentColor

The currentColor keyword makes the border use the element's computed color value.

Matching Text and Border Colors

.matching-border {
  color: #1769aa;
  border-block-start: 4px solid currentColor;
}

The text and block-start border use the same blue color.

Omitting the Color

.matching-border {
  color: #1769aa;
  border-block-start: 4px solid;
}

The result is the same because currentColor is the initial border color.

Inherited Text Color

.parent {
  color: #1769aa;
}
.child {
  border-block-start: 4px solid currentColor;
}

If the child inherits its text color from the parent, its border uses that inherited color.

Changing the Text Color

.interactive {
  color: #1769aa;
  border-block-start: 4px solid currentColor;
}
.interactive:hover {
  color: #d35400;
}

When the element's text color changes, the border color follows automatically.

This is useful for themed components and designs that use a shared foreground color.

Transparent and Semi-Transparent Borders

Border colors can be fully transparent or partially transparent.

Fully Transparent Border

.transparent-border {
  border-block-start: 4px solid transparent;
}

The border occupies space in the box model but is not visibly painted.

Semi-Transparent RGB Color

.alpha-border {
  border-block-start: 4px solid rgb(23 105 170 / 50%);
}

The border is drawn with 50% opacity, allowing the background to show through.

Semi-Transparent HSL Color

.hsl-alpha {
  border-block-start: 4px solid hsl(207 76% 38% / 40%);
}

The alpha component controls the transparency of the HSL color.

Reserving Space for Hover

.hover-panel {
  border-block-start: 4px solid transparent;
}
.hover-panel:hover {
  border-block-start-color: #1769aa;
}

The transparent border reserves its space before hover. Changing only the color avoids a border-width layout change.

Animating the Border Color

.animated-panel {
  border-block-start: 4px solid transparent;
  transition: border-block-start-color 200ms ease;
}
.animated-panel:hover {
  border-block-start-color: #1769aa;
}
@media (prefers-reduced-motion: reduce) {
  .animated-panel {
    transition: none;
  }
}

The transition gradually changes the border color while preserving its width and style.

Border Visibility

A border color alone does not create a visible border. The border must also have a visible style and a nonzero used width.

Color Without Style

.invisible {
  border-block-start-color: red;
  border-block-start-width: 5px;
}

The border is not displayed if its style remains none.

Adding a Style

.visible {
  border-block-start-color: red;
  border-block-start-width: 5px;
  border-block-start-style: solid;
}

The border becomes visible because its style is solid.

Zero Width

.zero-width {
  border-block-start-color: red;
  border-block-start-width: 0;
  border-block-start-style: solid;
}

The border has no thickness and is not visible.

none and hidden

.none-style {
  border-block-start: 5px none red;
}
.hidden-style {
  border-block-start: 5px hidden red;
}

Both styles suppress the visible border and produce a used border width of zero. The hidden style also has special precedence in collapsed table border conflicts.

Transparent Color

.transparent-style {
  border-block-start: 5px solid transparent;
}

The border retains its width but is not visibly painted.

The border-block-start-color property belongs to the logical border family.

Property Purpose
border-block-start Sets the width, style, and color of the block-start border.
border-block-start-color Sets only the block-start border color.
border-block-start-style Sets only the block-start border style.
border-block-start-width Sets only the block-start border width.
border-block-end-color Sets the color of the opposite logical block border.
border-block-color Sets the colors of both logical block borders.
border-inline-color Sets the colors of both logical inline borders.

Different Colors on Both Block Sides

.panel {
  border-block: 4px solid;
  border-block-start-color: #1769aa;
  border-block-end-color: #d35400;
}

The block-start border is blue, while the block-end border is orange.

Using border-block-color

.panel {
  border-block: 4px solid;
  border-block-color: #1769aa #d35400;
}

The first color applies to block-start, and the second applies to block-end.

Logical vs. Physical Colors

.logical {
  border-block-start-color: #1769aa;
}
.physical {
  border-top-color: #1769aa;
}

In horizontal writing mode, both declarations target the top border. In vertical writing, the logical property follows the block-start side, while the physical property remains on the top.

Shorthand and Longhand Interactions

Border shorthands can reset the block-start border color. The CSS cascade determines which declaration takes effect.

Overriding border-block-start

.panel {
  border-block-start: 4px solid #1769aa;
  border-block-start-color: #d35400;
}

The later longhand changes the border color to orange.

Shorthand Reset

.panel {
  border-block-start-color: #d35400;
  border-block-start: 4px solid #1769aa;
}

The later shorthand replaces the orange color with blue.

Omitted Shorthand Color

.panel {
  color: #1769aa;
  border-block-start-color: red;
  border-block-start: 4px solid;
}

The shorthand resets the color to currentColor, so the border uses the element's blue text color rather than red.

Overriding border-block-color

.panel {
  border-block: 4px solid #1769aa;
  border-block-color: #1769aa;
  border-block-start-color: #d35400;
}

The block-start border becomes orange, while the block-end border remains blue.

The border Shorthand

.panel {
  border-block-start-color: #d35400;
  border: 2px solid gray;
}

The later border shorthand sets all four physical border colors to gray, overriding the earlier logical color.

These examples assume equal origin, importance, specificity, and cascade layer priority. Higher-priority declarations can override later declarations.

Practical Uses

Changing the logical block-start border color can help distinguish sections, highlight components, and support reusable themes.

Section Accent

.content-section {
  border-block-start: 4px solid #1769aa;
  padding-block-start: 20px;
}

A colored block-start border creates a clear visual accent at the beginning of a section.

Highlighted Panel

.notice-panel {
  border-block-start: 5px solid #1769aa;
}
.notice-panel.warning {
  border-block-start-color: #d35400;
}

The warning class changes the accent color without changing the border thickness or style.

Themed Border

.themed-panel {
  --accent-color: #1769aa;
  border-block-start: 4px solid var(--accent-color);
}

A custom property allows the accent color to be maintained in one place.

Color Matching

.heading-panel {
  color: #1769aa;
  border-block-start: 3px solid currentColor;
}

The border automatically matches the text color.

Interactive Accent

.interactive-panel {
  border-block-start: 4px solid transparent;
}
.interactive-panel:hover {
  border-block-start-color: #1769aa;
}

The border becomes visible on hover without changing the element's border thickness.

When a border color communicates a status or state, provide accompanying text or another accessible indicator.

border-block-start-color Example

The following example demonstrates three block-start border colors in horizontal writing mode, followed by the same blue border color in two vertical writing modes.

<div class="border-block-start-color-demo">
  <div class="demo-box blue">Blue Border</div>
  <div class="demo-box orange">Orange Border</div>
  <div class="demo-box green">Green Border</div>
  <div class="demo-box vertical-right">vertical-rl</div>
  <div class="demo-box vertical-left">vertical-lr</div>
</div>
.border-block-start-color-demo {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  gap: 16px;
}
.border-block-start-color-demo .demo-box {
  box-sizing: border-box;
  inline-size: 160px;
  block-size: 100px;
  padding: 15px;
  border-block-start-width: 7px;
  border-block-start-style: solid;
  background-color: #e8f2fb;
  color: #173b5e;
  font-weight: bold;
  text-align: center;
}
.border-block-start-color-demo .blue {
  border-block-start-color: #1769aa;
}
.border-block-start-color-demo .orange {
  border-block-start-color: #d35400;
}
.border-block-start-color-demo .green {
  border-block-start-color: #21804a;
}
.border-block-start-color-demo .vertical-right {
  writing-mode: vertical-rl;
  border-block-start-color: #1769aa;
}
.border-block-start-color-demo .vertical-left {
  writing-mode: vertical-lr;
  border-block-start-color: #1769aa;
}
Browser Result
Blue Border
Orange Border
Green Border
vertical-rl
vertical-lr

The first three boxes demonstrate how changing border-block-start-color changes the color of the top border without affecting its width or style.

The final two boxes use the same blue color in vertical writing modes. The border appears on the right in vertical-rl and on the left in vertical-lr.

All five examples use the same logical border property, so the color remains associated with the block-start side regardless of writing mode.

Important Considerations

Keep the following points in mind when using border-block-start-color:

  • Logical border color: The property controls the color of the block-start border.
  • Initial value: The default value is currentColor.
  • Inheritance: The property is not inherited.
  • Writing mode: The physical border affected depends on writing-mode.
  • Horizontal writing: The property normally controls the top border color.
  • Vertical writing: It controls the right border in vertical-rl and the left border in vertical-lr.
  • Color formats: Named colors, hexadecimal notation, RGB, HSL, and other supported CSS color functions can be used.
  • currentColor: The border can follow the element's computed text color.
  • Transparency: Transparent and semi-transparent colors are supported.
  • Border visibility: A visible style and nonzero used width are required for the border to appear.
  • Width and style: This property does not change the specified border width or style.
  • Single side: Only the logical block-start border color is affected.
  • Both block sides: Use border-block-color to set both logical block border colors.
  • Shorthand: Use border-block-start to set width, style, and color together.
  • Physical borders: Logical and physical border color declarations may target the same edge depending on writing mode.
  • Shorthand resets: Later border shorthands can override the logical border color.
  • Animation: Border color changes can be animated or transitioned.
  • Compatibility: Newer color functions may have different browser support from the property itself.
  • Accessibility: Important information should not be communicated through border color alone.

Use border-block-start-color when the color of a logical block-start border needs to change without resetting its width or style.

Browser Support

The border-block-start-color property is widely supported in modern versions of Chrome, Edge, Firefox, Safari, and other major browsers.

The standard property does not require vendor prefixes. Modern color functions used as values may have separate compatibility requirements.

Standard Declaration

.panel {
  border-block-start-width: 4px;
  border-block-start-style: solid;
  border-block-start-color: #1769aa;
}

Physical Border Fallback

.panel {
  border-top: 4px solid #1769aa;
}
@supports (border-block-start-color: red) {
  .panel {
    border-top: 0;
    border-block-start: 4px solid #1769aa;
  }
}

This fallback assumes horizontal writing mode. Browsers supporting logical borders use the block-start border, while older browsers retain the physical top border.

For vertical writing modes, physical fallbacks must be adapted to the appropriate left or right side.

Visit Can I Use? to review current browser compatibility.

Specifications

The border-block-start-color property is defined in the CSS Logical Properties and Values Module Level 1 specification.

CSS Logical Properties and Values Module Level 1

General border color behavior is defined in the CSS Backgrounds and Borders Module Level 3 specification.

CSS Backgrounds and Borders Module Level 3