align-items

介绍

设置元素内容在交叉轴方向上的对齐方式。

取值

align-items: stretch;
align-items: center;
align-items: flex-start;
align-items: flex-end;
1
2
3
4
  • stretch
    默认值。 弹性元素在交叉轴方向被拉伸到与容器相同的高度或宽度。

  • center
    元素在交叉轴居中。

  • flex-start
    元素在交叉轴上对齐起始位置。

  • flex-end
    元素在交叉轴上对齐结尾位置。

  • auto
    等同于stretch

标准化语法

stretch | center | flex-start | flex-end | auto
1
Last Updated: 2022/7/15 下午7:22:06