The border-top-color property sets the color of an element’s physical top border. It does not set width or style. You can also set this color with border-top or border-color.
The initial value is currentColor, so the top border matches the element’s text color until you override it. A visible border-top-style and non-zero border-top-width are still required for the color to show.
Baseline · Widely available.
Not deprecated. Standard <color> values are safe everywhere. Newer striped / <image-1D> border colors from CSS Borders Level 4 are not covered here and are not Baseline yet.
Syntax
CSS Syntax
syntax.css
border-top-color:<color> | initial | inherit;
Accepts any CSS color: named colors, hex, rgb(), hsl(), currentColor, or transparent.
Keep width and style. The top border still exists in the box model.
Set color to transparent. The stroke does not paint, so you do not see a line.
Space remains. Unlike border-top-style: none, a transparent colored border can still reserve its width.
Useful for alignment. Pair with other sides that stay opaque when you need matching padding without a visible top line.
Edge Cases & Pitfalls
If the top color seems missing, one of these is usually why.
style
Color alone never draws a border
You need a visible border-top-style and a non-zero width. Without them, border-top-color has nothing to paint.
shorthand
border-top can overwrite your color
A later border-top shorthand resets omitted parts, including color (back toward currentColor). Set the longhand after the shorthand if both are needed.
logical
Physical top is not always block-start
In vertical writing modes, use border-block-start-color when the colored edge should follow the logical start side instead of the screen top.
default
Unset means currentColor
If you never set a top color, the border uses the element’s text color. That can look like a bug when you change text color and the border follows.
sides
Need every side the same color?
Use border-color. Reach for border-top-color when only the top edge should differ.
Compatibility
Browser Support
border-top-color is a browser CSS property for the box model. Node.js, Deno, and Bun do not apply it.
✓ Baseline · Widely available
border-top-color
Supported in all modern browsers and Internet Explorer. Standard color values have been part of CSS since the earliest versions.
100%Universal support
Google ChromeAll versions
Full support
Mozilla FirefoxAll versions
Full support
Apple SafariAll versions
Full support
Microsoft EdgeAll versions
Full support
OperaAll versions
Full support
Samsung InternetAll versions
Full support
Internet ExplorerAll versions
Full support
border-top-colorWidely supported
Bottom line: Safe everywhere for standard <color> values. Prefer the longhand when you only need to change the top color. It is not a runtime API.
Remember
Key Takeaways
Role: set the color of the physical top border only.
Needs a line first: visible style + width, then color.
Initial value:currentColor. Not inherited by default.
Shorthands:border-top and border-color can set the same color.
One line: use border-top-color when the top edge already has a border and you only need to change its paint.
Frequently Asked Questions
It sets the color of the border on the physical top edge only. It does not set width or style.
The initial value is currentColor, which uses the element's computed text color for the top border.
Color alone is not enough. You also need a visible border-top-style (such as solid) and a non-zero border-top-width, or use the border-top shorthand.
border-top-color always paints the physical top edge. border-block-start-color follows writing-mode, so in vertical text it may map to a side instead of the top.
Yes. border-top and border-color can set the top color. Use border-top-color when you want to change only the color after width and style are already set.
It is Baseline Widely available and works in all modern browsers and Internet Explorer. It is a browser CSS property, not a Node.js feature.