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

# line-height

APISummary
## Introduction

The `line-height` CSS property sets the height of a line box. It's commonly used to set the distance between lines of text.

## Examples

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

**Entry:** `src/line-height`
**Bundle:** `dist/line-height.lynx.bundle`

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

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

  const text1Style = {
    lineHeight: "30px",
  };

  const text2Style = {
    fontSize: "16px",
    lineHeight: "3",
  };

  const text3Style = {
    fontSize: "16px",
    lineHeight: "50px",
  };

  const inlineText1Style = {
    fontSize: "30px",
  };

  const inlineText2Style = {
    fontSize: "40px",
  };

  return (
    <scroll-view className="root" scroll-orientation="vertical">
      <view className="fixed_area">
        <view style={containerStyle}>
          <text className="item" style={text1Style}>XX{"\n"}XX{"\n"}XX</text>
          <text className="item" style={text2Style}>XX{"\n"}XX{"\n"}XX</text>
          <text className="item" style={text3Style}>
            XX
            <text style={inlineText1Style}>XX</text>
            <text style={inlineText2Style}>XX</text>
          </text>
        </view>
      </view>
    </scroll-view>
  );
};

root.render(<LineHeight />);

```

v0.11.0



## Syntax

```css
line-height: normal;
line-height: 3.5;
```

### Values

- normal 

  Default value.

- `<number>` 

  The used value is this unitless `<number>` multiplied by the element's own font size.

- `<length>` 

  The specified `<length>` is used in the calculation of the line box height.

## Formal definition

| Initial value | normal |
| Applies to | text |
| Inherited | yes |
| Animatable | no |


## Formal syntax

```
normal | <length> | <number>
```

## Differences from the Web

- `line-height` only effect `<text>` element.

## Best Practices

- `line-height` in lynx will clip text content, so the value must be greater than element's font-size

- `line-height` is **paragraph style** . set in inline text has no effect.

## Compatibility

**Compatibility Table**

**Query:** `css.properties.line-height`

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

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

**`line-height`**

**Specifications:**

