Skip to content

Flex

Flex 类用于实现弹性布局

  • flex: 使用弹性布局,开启弹性布局,另外一个效果是使内部的元素变成左右布局

    flex-row, flex-col: 设置主轴为行或列

  • justify-center: 在主轴(水平轴)上居中

    其他的对齐方式:

    justify-start, justify-center, justify-end, justify-between, justify-around

  • items-center:在交叉轴(垂直轴)上具体

    其他的对齐方式:

    items-start, items-center, items-end, items-stretch

目前felx也可以使用gap来设置元素的间距,如gap-2

Released under the MIT License.