justify-self

介绍

网格布局中,设置网格区域(grid area)中的元件在行轴方向的轴上对齐。此属性作用在网格项目上。justify-self 可覆盖网格容器定义的 justify-items

INFO

Lynx 不支持 writing-mode,所以行轴就是水平轴。

使用示例

语法

justify-self: auto;
justify-self: stretch;
justify-self: center;
justify-self: start;
justify-self: end;

取值

auto

默认值。根据 justify-items 定义的方式对齐。

stretch

除非元件具有确定的宽度。也就是说在默认情况下,元件会在行轴方向上覆盖网格区域。

center

定义元件在网格区域的行轴方向上居中。

start

定义元件在行轴上与网格区域的起始边缘对齐。

end

定义元件在行轴上与网格区域的结束边缘对齐。

形式定义

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

形式语法

justify-self = auto | stretch | center | start | end

与 Web 的区别

mdn: justify-self

  1. 不支持 normal。默认值为 auto
  2. 不支持 flex-startflex-endself-startself-endleftright

兼容性

LCD tables only load in the browser

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