> 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

APISummary
## Introduction

The border shorthand CSS property sets an element's border. It sets the values of [border-width](/next/api/css/properties/border-width.md), [border-style](/next/api/css/properties/border-style.md), and [border-color](/next/api/css/properties/border-color.md).

## Examples

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

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

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

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

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

  const styles = [
    ["thick double red", "thin dotted blue"],
    ["10px solid orange", "medium solid #0000ff"],
    ["5px groove rgba(0,255,0,0.6)", "10rpx ridge hsl(89,43%,51%)"],
    ["thick outset hsla(89,43%,51%,0.3)", "16px inset #ab0"],
  ];

  return (
    <scroll-view className="root" scroll-orientation="vertical" style={scrollViewStyle}>
      s
      <view className="fixed_area" style={fixedAreaStyle}>
        {styles.map((row, rowIndex) => (
          <view key={`normal-${rowIndex}`}>
            <view className="row">
              {row.map((borderStyle, colIndex) => (
                <view key={`normal-${rowIndex}-${colIndex}`} className="box" style={{ border: borderStyle }}>
                  <text className="text">{borderStyle}</text>
                </view>
              ))}
            </view>
          </view>
        ))}

        {styles.map((row, rowIndex) => (
          <view key={`radius-${rowIndex}`}>
            <view className="row">
              {row.map((borderStyle, colIndex) => (
                <view
                  key={`radius-${rowIndex}-${colIndex}`}
                  className={`box radiusStyle${colIndex}`}
                  style={{ border: borderStyle }}
                >
                  <text className="text">{borderStyle}</text>
                </view>
              ))}
            </view>
          </view>
        ))}
      </view>
    </scroll-view>
  );
};

root.render(<Border />);

```

v0.11.0



## Syntax

```css
/* style */
border: solid;

/* width | style */
border: 2px dotted;

/* style | color */
border: outset #f33;

/* width | style | color */
border: medium dashed green;
```

### Values

This property is a shorthand for the following CSS properties:

- [`border-width`](/next/api/css/properties/border-width.md)
  Sets the thickness of the border.

- [`border-style`](/next/api/css/properties/border-style.md)
  Sets the style of the border.

- [`border-color`](/next/api/css/properties/border-color.md)
  Sets the color of the border.

## Formal definition

| Initial value | empty value |
| Applies to | all elements |
| Inherited | no |
| Animatable | no |


## Formal syntax

```
<line-width> || <line-style> || <color>
where
<line-width> = <length> | thin | medium | thick
<line-style> = none | hidden | dotted | dashed | solid | double | groove | ridge | inset | outset

```

## Differences from the Web

- [mdn:border](https://developer.mozilla.org/en-US/docs/Web/CSS/border)

Lynx does not support inherit, initial, revert, or unset.

## Compatibility

**Compatibility Table**

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

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

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

**`border`**

**Specifications:**

