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/relative-top-of.md.
Lynx
  • 简体中文
  • relative-top-of

    介绍

    相对布局中,设置当前元件在指定对应 id 的同级元件的上方。

    使用示例

    语法

    relative-top-of: none;
    relative-top-of: 1;
    relative-top-of: 2;

    取值

    • none

      默认值。不设置此属性。

    • <number>

      int 值。设置当前元件在指定对应 id 的同级元件的上方。

      Info

      id 的设定请注意:-10 是特殊值。-1 是默认值,代表当前元件不会被视为同级元件的对齐参考标准。不能使用 0 作为元件的 id,否则有不符合预期的表现。

    形式定义

    初始值none
    适用元素relative items
    是否支持继承
    是否支持动画

    形式语法

    relative-top-of = none | <number>

    与 Web 的区别

    • Web 无此属性。

    兼容性

    LCD tables only load in the browser

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