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

# text-indent

APISummary
## Introduction

The text-indent attribute can define the indentation before the first line of text content of a text.

## Examples

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

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

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

const TextIndent = () => {
  const textStyle = {
    textIndent: "10px",
  };

  return (
    <text style={textStyle}>
      hello world, Now we can use text-indent in the text node
    </text>
  );
};

root.render(<TextIndent />);

```

v0.11.0



## Syntax

```css
/* <length> values */
text-indent: 40px;

/* <percentage> value
   relative to the containing block width */
text-indent: 15%;
```

### Values

- [`<length>`](/next/api/css/data-type/length.md)
  Length value, defaults to 0

- [`<percentage>`](/next/api/css/data-type/percentage.md)
  Percentage relative to the `text` width

## Formal definition

| Initial value | 0 |
| Applies to | text |
| Inherited | no |
| Animatable | no |


## Formal syntax

```
<length> | <percentage>
```

## Differences from the Web

When writing **percentage**, you need to specify the width of the text element, otherwise, it will not take effect

## Compatibility

**Compatibility Table**

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

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

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

**`text-indent`**

**Specifications:**

