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, and this page is available as Markdown at /next/zh/api/css/properties/text-align.md.
Lynx
  • 简体中文
  • text-align

    介绍

    text-align 属性设置文本内容的对齐方式。

    使用示例

    语法

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

    取值

    • left 行内内容向左侧边对齐。

    • right 行内内容向右侧边对齐。

    • center 行内内容居中。

    • start 文字对齐阅读开始方向侧边。 LTR 模式下等价 leftRTL 模式下等价 rightdirectionnormal 时,start 跟随文字内容方向。

    • end 文字对齐阅读开始方向侧边。 LTR 模式下等价 rightRTL 模式下等价 left

    形式定义

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

    形式语法

    left | right | center | start | end

    与 Web 的区别

    • 不支持 justifyjustify-all

    • 不支持 match-parent

    兼容性

    LCD tables only load in the browser

    除非另有说明,本项目采用知识共享署名 4.0 国际许可协议进行许可,代码示例采用 Apache License 2.0 许可协议进行许可。