Use one color for every side, or up to four colors in clockwise order: top, right, bottom, left. It applies to all elements, including ::first-letter, and it is not inherited. Each side defaults to currentColor (the element’s color). Color alone does not paint a border until border-style is visible.
Standard-track.
Not deprecated. Ordinary <color> values are Baseline. The newer Level 4 stripes() / image-border syntax is experimental and not ready as a sole production value.
Set text color.color: #2563eb makes the words blue.
Draw a solid border. Width and style are set without a fixed color.
Link the border.border-color: currentColor uses that same blue.
Change once, update both. Editing color updates the text and the border together. That is also why the initial border color follows text color.
Edge Cases & Pitfalls
If the border color seems missing or wrong, check these first.
style
Color without style stays invisible
Default border-style is none. Set solid (or another visible style) and a width greater than zero.
order
Four values are clockwise
Remember top, right, bottom, left. Mixing that order with left-to-right thinking is a common mistake.
transparent
transparent still takes space
A transparent border keeps its width in the layout. Use it for hover swaps or alignment tricks, not to remove the border box.
shorthand
border can reset color
A later border shorthand may overwrite your border-color. Set color after the shorthand, or include the color in the shorthand.
non-standard
Avoid -moz-border-*-colors
Firefox-only multi-color side properties are non-standard. Prefer the standard one-to-four value border-color shorthand.
Compatibility
Browser Support
border-color is a browser CSS property for element borders. Node.js, Deno, and Bun do not apply it.
✓ Baseline · Widely available
border-color
Chrome 1+, Firefox 1+, Safari 1+, Edge 12+, Internet Explorer 4+. One-to-four color values are long-established.
99%Global support
Google Chrome1+
Full support
Mozilla Firefox1+
Full support
Apple Safari1+
Full support
Microsoft Edge12+
Full support
Opera3.5+
Full support
Samsung Internet1+
Full support
Internet Explorer4+
Full support
border-colorWidely supported
Bottom line: Safe for production. Stick to standard <color> values. Treat Level 4 stripe/image border colors as experimental for now.
Remember
Key Takeaways
Role: shorthand for the four physical border side colors.
Needs style: pair with a visible border-style and width, or use border.
Initial value:currentColor on each side. Not inherited.
Value count: 1, 2, 3, or 4 colors. Four values go top → right → bottom → left.
One line:border-color paints the border — after style and width make that border visible.
Frequently Asked Questions
It is a shorthand that sets the color of an element's borders. One value paints all four sides. Two, three, or four values set sides in top-right-bottom-left order.
Each side defaults to currentColor, which means the border uses the element's text color until you set a different border color.
Color alone does not draw a border. You also need a visible border-style such as solid and a width greater than zero, or use the border shorthand.
Yes. With four values, colors apply to top, right, bottom, and left in that order. You can also set each side with border-top-color and the other longhands.
No. Set it on the element that needs the border. The initial value still follows currentColor, which tracks that element's color property.
It is Baseline and widely available: Chrome 1+, Firefox 1+, Safari 1+, Edge 12+, and Internet Explorer 4+. It is a browser style property, not a Node.js feature.