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

APISummary
## Introduction

The `text-align` CSS property sets the horizontal alignment of the inline-level content inside a block element.

## Examples

![](https://lf-lynx.tiktok-cdns.com/obj/lynx-artifacts-oss-sg/lynx-website/assets/doc/text-align-normal.jpeg)
![](https://lf-lynx.tiktok-cdns.com/obj/lynx-artifacts-oss-sg/lynx-website/assets/doc/text-align-ltr.jpeg)
![](https://lf-lynx.tiktok-cdns.com/obj/lynx-artifacts-oss-sg/lynx-website/assets/doc/text-align-rtl.jpeg)
![](https://lf-lynx.tiktok-cdns.com/obj/lynx-artifacts-oss-sg/lynx-website/assets/doc/text-align-lynx-rtl.jpeg)
## Syntax

```css
/* Keyword values */
text-align: start;
text-align: end;
text-align: left;
text-align: right;
text-align: center;
```

### Values

- `left`
  The inline contents are aligned to the left edge of the line box.

- `right`
  The inline contents are aligned to the right edge of the line box.

- `center`
  The inline contents are centered within the line box.

- `start`
  The same as left if direction is left-to-right and right if direction is right-to-left.
  **When `direction` is `normal`, `start` is the nature direction of text。**

- `end`
  The same as right if direction is left-to-right and left if direction is right-to-left.

## Formal definition

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


## Formal syntax

```
left | right | center | start | end
```

## Differences from the Web

- Not support `justify-all` and `justify`.

- Not support `match-parent`.

## Compatibility

**Compatibility Table**

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

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

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

**`text-align`**

**Specifications:**

