justify-content

介绍

设置flex容器内的各个元素在主轴(水平)方向上的排列方式。

取值

justify-content: flex-start;
justify-content: flex-end;
justify-content: center;
justify-content: space-between;
justify-content: space-around;
justify-content: space-evenly;
1
2
3
4
5
6
  • flex-start 默认值。 使元素位于容器的开头。

  • flex-end 使元素位于容器的结尾。

  • center 使元素位于容器的中心。

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

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

  • space-evenly 使元素位于各列之前,之间和之后都留有空白的容器内, 且留有的空白等距。

标准化语法

center | flex-start | flex-end | space-between | space-around | space-evenly
1
Last Updated: 2022/7/15 下午7:22:06