align-content

介绍

在弹性容器内的各项没有占用交叉轴上所有可用的空间时,设置对齐容器内的各项(垂直)的方式

取值

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

  • center
    元素在交叉轴居中。

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

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

  • space-between
    使元素位于各行间留有空白的容器内。

  • space-around
    使元素位于各行之前,之间和之后都留有空白的容器内。

标准化语法

stretch | center | flex-start | flex-end | space-between | space-around
1

注意事项

此属性必须有多行项目才能生效

Last Updated: 2022/7/15 下午7:22:06