text-align

Introduction

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

Examples

Syntax

/* 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 valuestart
Applies totext
Inheritedyes
Animatableno

Formal syntax

left | right | center | start | end

Difference with web

  • Not support justify-all and justify.

  • Not support match-parent.

Compatibility

LCD tables only load in the browser

Except as otherwise noted, this work is licensed under a Creative Commons Attribution 4.0 International License, and code samples are licensed under the Apache License 2.0.