css Flex容器属性有哪些

385次阅读
没有评论

css

1、flex-direction设置主轴的方向

即项目的排列方向。

flex-direction: row | row-reverse | column | column-reverse;

2、flex-wrap

默认情况下,item都排在一条线(又称”轴线”)上。flex-wrap属性定义了,如果一条轴线排不下,item的换行方式。

flex-wrap: nowrap | wrap | wrap-reverse;

3、flex-flow

flex-flow属性是flex-direction属性和flex-wrap属性的简写形式,默认值为row nowrap。

.box {
  flex-flow: <flex-direction> <flex-wrap>;
}

4、justify-content

定义了项目在主轴上的对齐方式。

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

5、align-items

设置了项目在交叉轴上的对齐方式。

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

6、align-content

多根轴线的对齐方式。

align-content: flex-start | flex-end | center | space-between | space-around | stretch;

以上就是css Flex容器6种属性的介绍,希望对大家有所帮助。更多css学习指路:css教程

本文教程操作环境:windows7系统、css3版,DELL G3电脑。

神龙|纯净稳定代理IP免费测试>>>>>>>>天启|企业级代理IP免费测试>>>>>>>>IPIPGO|全球住宅代理IP免费测试

相关文章:

版权声明:JavaScript2022-12-19发表,共计721字。
新手QQ群:570568346,欢迎进群讨论 Python51学习