justify-items

介绍

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

INFO

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

使用示例

取值

stretch

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

center

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

start

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

end

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

语法

justify-items: stretch;
justify-items: center;
justify-items: start;
justify-items: end;

形式定义

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

形式语法

justify-items = stretch | center | start | end

与 Web 的区别

mdn: justify-items

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

兼容性

LCD tables only load in the browser

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