> 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.

# text-decoration

APISummary
## 介绍

`text-decoration` 属性用于设置文本的修饰线外观。它是 `text-decoration-line`, `text-decoration-color`, `text-decoration-style` 属性的缩写。

## 使用示例

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

**Entry:** `src/text-decoration`
**Bundle:** `dist/text-decoration.lynx.bundle`

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

const TextDecoration = () => {
  const containerStyle = {
    width: "100%",
    height: "100%",
    flexDirection: "column" as const,
  };

  const headerStyle = {
    backgroundColor: "#ccc",
    marginTop: "10px",
  };

  const noneStyle = {
    textDecoration: "none",
  };

  const underlineStyle = {
    textDecoration: "underline",
  };

  const lineThroughStyle = {
    textDecoration: "line-through",
  };

  const redSolidStyle = {
    textDecoration: "underline line-through red solid",
  };

  const greenDottedStyle = {
    textDecoration: "underline line-through green dotted",
  };

  const blueDashedStyle = {
    textDecoration: "underline line-through blue dashed",
  };

  return (
    <scroll-view className="root" scroll-orientation="vertical">
      <view className="fixed_area">
        <view style={containerStyle}>
          <text style={headerStyle}>text-decoration</text>
          <text style={noneStyle}>None</text>
          <text style={underlineStyle}>Underline</text>
          <text style={lineThroughStyle}>Line Through</text>
          <text style={redSolidStyle}>Red Solid Line</text>
          <text style={greenDottedStyle}>Green Dotted Line</text>
          <text style={blueDashedStyle}>Blue Dashed Line</text>
        </view>
      </view>
    </scroll-view>
  );
};

root.render(<TextDecoration />);

```

v0.11.0



## 语法

```css
text-decoration: underline;
text-decoration: line-through red;
text-decoration: none;
```

### 取值

#### **text-decoration-line**

用于设置元件中的文本的修饰类型。

- `none` 

  **默认值**无修饰线。

- `underline`
  在文本的下方有一条修饰线。

- `line-through`
  有一条贯穿文本中间的修饰线。

#### **text-decoration-color**

- [`<color>`](/next/zh/api/css/data-type/color.md)
  修饰文本的线的颜色。

#### **text-decoration-style**

用于设置由 `text-decoration-line` 设定的线的样式

- `solid`
  画一条实线。

- `double`
  画一条双实线。

- `dotted`
  画一条点划线。

- `dashed`
  画一条虚线。

- `wavy`
  画一条波浪线。

## 形式定义

| 初始值 | 空值 |
| 适用元素 | text |
| 是否支持继承 | yes |
| 是否支持动画 | no |


## 与 Web 的区别

- 不支持 [`text-decoration-thickness`](https://developer.mozilla.org/zh-CN/docs/Web/CSS/text-decoration-thickness)
- 不支持在同一个文本上设置多条修饰线。

## 兼容性

**Compatibility Table**

**Query:** `css.properties.text-decoration`

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

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

**`text-decoration`**

**Specifications:**

