CKTIS / CSS
border-color — border colors
The border-color shorthand sets the colors of the four physical border sides. It accepts one to four color values without changing the line style or width. A visible border also requires an appropriate style and a nonzero width.
Version: CSS modules; structured CSSWG indexes reconciled with pinned MDN BCD; Chromium 152 scope gate, per-example verification still required
Syntax
/* Level 3 */
border-color: <color>{1,4};
/* Level 4 draft extension; implementation verification required */
border-color: [ <color> | <image-1D> ]{1,4};border-color is shorthand for border-top-color, border-right-color, border-bottom-color, and border-left-color. It sets colors for physical border sides, not writing-direction-relative sides. It does not change border-style or border-width.
Separate values with spaces: one applies to all sides; two mean top/bottom and right/left; three mean top, right/left, and bottom; four mean top, right, bottom, and left in that order. The notation <color>{1,4} describes this value count in the specification grammar—you do not type the braces into a declaration.
The individual side properties are not inherited, and their initial value is currentColor, meaning the color supplied by the same element’s color property. Setting a color alone does not create a visible line: the initial border-style is none. For example, use border: 8px solid before border-color. A later border declaration can reset the colors, even when it omits a color.
Level 3 accepts <color> values. The Level 4 draft extends the grammar with <image-1D>, allowing color bands through stripes(). Inclusion in a draft does not establish browser support; the extension requires separate verification and is not used in the example.
Examples
<!doctype html>
<meta charset="utf-8">
<title>border-color</title>
<style>
.box {
width: 160px;
height: 80px;
border: 8px solid;
border-color: #ff0000 #008000 #0000ff #000000;
}
</style>
<div class="box"></div>Result
A 160px × 80px content box with an 8px solid border: top #ff0000, right #008000, bottom #0000ff, left #000000.
The displayed code and declared result were verified in an isolated environment using the method recorded in the verification evidence for this exact version.