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/linear-gravity.md.
Lynx
  • English
  • deprecated linear-gravity

    Warning

    This API is deprecated.

    Introduction

    The CSS linear-gravity property defines how distributes space between and around content items along the main-axis of a linear container. Similar to flexible box layout justify-content.

    Info

    When using justify-content and linear-gravity both, linear-gravity will override justify-content.

    Examples

    Syntax

    linear-gravity: none;
    linear-gravity: start;
    linear-gravity: end;
    linear-gravity: center;
    linear-gravity: space-between;

    Values

    • none

      Default value. It is equivalent to start.

    • start

      Align the beginning of the parent element main axis.

    • end

      Align the end of the parent element main axis.

    • center

      Align the center of the parent element's main axis.

    • space-between

    In the corresponding layout direction, the two ends are aligned and the middle interval is equal.

    • top deprecated

      Not recommended, it is recommended to use start. Align up, vertical layout takes effect.

    • bottom deprecated

      Not recommended, it is recommended to use end. Align down, vertical layout takes effect.

    • left deprecated

      Not recommended, it is recommended to use start. Align left, horizontal layout takes effect.

    • right deprecated

      Not recommended, it is recommended to use end. Align right, horizontal layout takes effect.

    • center-vertical deprecated

      Not recommended, it is recommended to use center. Centered vertically, vertical layout takes effect.

    • center-horizontal deprecated

      Not recommended, it is recommended to use center. Centered horizontally, horizontal layout takes effect.

    Formal definition

    Initial valuenone
    Applies tolinear containers
    Inheritedno
    Animatable

    Formal syntax

    linear-gravity = none | start | end | center | space-between

    Difference between web

    • 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.