> For AI agents: the complete documentation index is available at /next/llms.txt, the full documentation bundle is available at /next/llms-full.txt.

# border-color

APISummary
## Introduction

The `border-color` shorthand CSS property sets the color ([`border-top-color`](/next/api/css/properties/border-top-color.md), [`border-right-color`](/next/api/css/properties/border-right-color.md), [`border-bottom-color`](/next/api/css/properties/border-bottom-color.md), [`border-left-color`](/next/api/css/properties/border-left-color.md)) of an element's border.

## Examples

**This is an example below: css-api**

**Entry:** `src/border-color`
**Bundle:** `dist/border-color.lynx.bundle`

```tsx
import { root } from "@lynx-js/react";
import "./index.scss";

const BorderColor = () => {
  const scrollViewStyle = {
    height: "100%",
  };

  const fixedAreaStyle = {
    width: "100%",
    height: "100%",
    flexDirection: "column" as const,
  };

  const colors = [
    ["red", "rgb(255,0,0) rgba(0,255,0,0.3)"],
    ["#ff0000 #00ff00ff #aabbccdd", "black orange transparent pink"],
    ["black rgb(255,255,0) #ff00ff pink", "hsl(89,43%,51%) hsla(89,43%,51%,0.3) red transparent"],
  ];

  const colors2 = [
    ["green blue", "pink rgb(0,0,255) rgba(128,0,128,0.8)"],
    ["#ff00ff #00ffffbb #2211ffaa", "blue pink"],
    ["#aab #ff00ff hsl(89,43%,20%)", "hsl(89,60%,31%) blue"],
  ];

  return (
    <scroll-view className="root" scroll-orientation="vertical" style={scrollViewStyle}>
      <view className="fixed_area" style={fixedAreaStyle}>
        {colors.map((row, rowIndex) => (
          <view key={`solid-${rowIndex}`}>
            <view className="row">
              {row.map((color, colIndex) => (
                <view
                  key={`solid-${rowIndex}-${colIndex}`}
                  className="box widthSame solid"
                  style={{ borderColor: color }}
                >
                  <text className="text">{color}</text>
                </view>
              ))}
            </view>
          </view>
        ))}

        {colors2.map((row, rowIndex) => (
          <view key={`style-${rowIndex}`}>
            <view className="row">
              {row.map((color, colIndex) => (
                <view
                  key={`style-${rowIndex}-${colIndex}`}
                  className={`box widthSame styleDiff${colIndex}`}
                  style={{ borderColor: color }}
                >
                  <text className="text">{color}</text>
                </view>
              ))}
            </view>
          </view>
        ))}

        {colors.map((row, rowIndex) => (
          <view key={`radius-${rowIndex}`}>
            <view className="row">
              {row.map((color, colIndex) => (
                <view
                  key={`radius-${rowIndex}-${colIndex}`}
                  className={`box widthDiff styleDiff${colIndex} radiusStyle${colIndex}`}
                  style={{ borderColor: color }}
                >
                  <text className="text">{color}</text>
                </view>
              ))}
            </view>
          </view>
        ))}
      </view>
    </scroll-view>
  );
};

root.render(<BorderColor />);

```

v0.11.0



## Syntax

```css
/* border-color: color; */
border-color: red;

/* border-color: vertical horizontal; */
border-color: red #f015ca;

/* border-color: top horizontal bottom; */
border-color: red yellow green;

/* border-color: top right bottom left; */
border-color: red yellow green blue;
```

### Values

The [`<color>`](/next/api/css/data-type/color.md) property may be specified using one, two, three, or four values.

- When one value is specified, it applies the same color to all four sides.
- When two values are specified, the first color applies to the [`border-top-color`](/next/api/css/properties/border-top-color.md) and [`border-bottom-color`](/next/api/css/properties/border-bottom-color.md), the second to the [`border-left-color`](/next/api/css/properties/border-left-color.md) and [`border-right-color`](/next/api/css/properties/border-right-color.md).
- When three values are specified, the first color applies to the [`border-top-color`](/next/api/css/properties/border-top-color.md), the second to the [`border-left-color`](/next/api/css/properties/border-left-color.md) and [`border-right-color`](/next/api/css/properties/border-right-color.md), the third to the [`border-bottom-color`](/next/api/css/properties/border-bottom-color.md).
- When four values are specified, the colors apply to the [`border-top-color`](/next/api/css/properties/border-top-color.md), [`border-right-color`](/next/api/css/properties/border-right-color.md), [`border-bottom-color`](/next/api/css/properties/border-bottom-color.md) and [`border-left-color`](/next/api/css/properties/border-left-color.md) in that order (clockwise).

## Formal definition

| Initial value | transparent |
| Applies to | all elements |
| Inherited | no |
| Animatable | yes |


## Formal syntax

```
<color>{1, 4}
```

## Compatibility

**Compatibility Table**

**Query:** `css.properties.border-color`

[Source](https://github.com/lynx-family/lynx/blob/develop/tools/css_generator/css_defines/60-border-color.json) · [MDN](https://developer.mozilla.org/en-US/docs/Web/CSS/border-color)

| Feature | Android | HarmonyOS | iOS | macOS | Windows | Web |
| --- | --- | --- | --- | --- | --- | --- |
| border-color | Yes (1.0) | Yes (3.4) | Yes (1.0) | Yes (1.0) | Yes (1.0) | Yes |

**`border-color`**

**Specifications:**

