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/linear-direction.md.
Lynx
  • 简体中文
  • linear-direction

    介绍

    linear-direction 定义线性布局中的元件排列方向(默认为垂直布局),该方向作为线性布局的主轴,另外一个方向称为交叉轴

    请注意,值 rowrow-reverse 受线性布局中的 direction 影响。例如,如果 dir 属性是 rtl 或者 lynx-rtlrow 表示从右到左定向的轴,而 row-reverse 表示从左到右。

    使用示例

    语法

    linear-direction: column;
    
    /* Like <column>, but reversed */
    linear-direction: column-reverse;
    
    linear-direction: row;
    
    /* Like <row>, but reversed */
    linear-direction: row-reverse;

    取值

    • column

      默认值。线性布局中的元件按照垂直方向进行布局。主轴的方向为垂直方向。

    • row

      线性布局中的元件按照水平方向进行布局。主轴的方向为水平方向。

    • column-reverse

      column 表现一致,但是置换了主轴起点和主轴终点。

    • row-reverse

      row 的表现一致,但是置换了主轴起点和主轴终点。

    • vertical deprecated

      column

    • horizontal deprecated

      row

    • horizontal-reverse deprecated

      row-reverse

    • vertical-reverse deprecated

      column-reverse

    形式定义

    初始值column
    适用元素线性容器
    是否支持继承
    是否支持动画

    形式语法

    linear-direction = column | row | column-reverse | row-reverse

    与 Web 的区别

    • Web 无该样式。

    兼容性

    LCD tables only load in the browser

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