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

# border-style

APISummary
## 介绍

用于设置四个边框的样式，该属性可按顺序设置上边框样式、右边框样式、下边框样式、左边框样式。

## 使用示例

**下面是一个示例: css-api**

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

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

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

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

  const styles = [
    ["solid", "dashed", "dotted"],
    ["double", "groove", "ridge"],
    ["inset", "outset", "hidden"],
    ["dotted groove", "dotted solid double", "groove solid double dashed"],
    ["outset inset", "solid none dashed", "dotted solid dashed inset"],
  ];

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

        {styles.map((row, rowIndex) => (
          <view key={`normal2-${rowIndex}`}>
            <view className="row">
              {row.map((style, colIndex) => (
                <view
                  key={`normal2-${rowIndex}-${colIndex}`}
                  className="box colorWidthSame"
                  style={{ borderStyle: style }}
                >
                  <text className="text">{style}</text>
                </view>
              ))}
            </view>
          </view>
        ))}

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

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

root.render(<BorderStyle />);

```

v0.11.0



## 语法

```css
border-style: double solid dotted dashed;
```

### 取值

- none | hidden | dotted | dashed | solid | double | groove | ridge | inset | outset
- 支持 1 - 4 值语法（上 → 右 → 下 → 左）

## 形式定义

| 初始值 | solid |
| 适用元素 | 所有元件 |
| 是否支持继承 | no |
| 是否支持动画 | no |


## 形式语法

```css

border-style = [ <line-style> ]{1,4}
<line-style> = none | hidden | dotted | dashed | solid | double | groove | ridge | inset | outset

```

## 与 Web 的区别

- [MDN 参考](https://developer.mozilla.org/zh-CN/docs/Web/CSS/border-style)
- 默认值不同（Web 为 `none`）
- 值为 `none`/`hidden` 时边框宽度保持原值（Web 会置为 `0`）
- 不支持 `inherit`/`initial`/`revert`/`unset` 全局值

## 兼容性

**Compatibility Table**

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

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

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

**`border-style`**

**Specifications:**

