For AI agents: the complete documentation index is available at /next/llms.txt, the full documentation bundle is available at /next/llms-full.txt, and this page is available as Markdown at /next/api/css/properties/relative-align-top.md.
Lynx
  • English
  • relative-align-top

    Introduction

    In relative-layout, specifies that the current element is aligned with the top edge of the parent or sibling element corresponding to id.

    Examples

    Syntax

    relative-align-top: parent;
    relative-align-top: none;
    
    relative-align-top: 1;
    relative-align-top: 2;

    Values

    • none

      Default Value. Does not align on the top edge.

    • parent

      The top edge is aligned with the parent element.

    • <number>

      int only. The top edge is aligned with the sibling element corresponding to this value(refer to relative-id).

      Info

      Attention please when setting relative-id: -1 and 0 are special values. -1 is the default value, indicating that the current element will not be considered as the alignment reference standard for sibling elements. Using 0 as an element ID is not allowed, as it will result in unexpected behavior.

    Formal definition

    Initial valuenone
    Applies torelative items
    Inheritedno
    Animatable

    Formal syntax

    relative-align-top = none | parent | <number>

    Difference between web

    • There is no such style in web.

    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.