如何更好的记住flex布局

2018-08-18  本文已影响5人  悦者生存

1.flex-direction属性

flex-direction属性决定主轴的方向(即项目的排列方向)。

.box {

  flex-direction: row | column 

}

2. justify-content属性

justify-content属性定义了项目在主轴上的对齐方式。

.box {

  justify-content: flex-start | flex-end | center | space-between

}

3. align-items属性

align-items属性定义项目在交叉轴上如何对齐。

.box {

  align-items: flex-start | flex-end | center 

}

无论是justify-content还是align-item放到中间显示都是center

上一篇 下一篇

猜你喜欢

热点阅读