微信公众号搜"智元新知"关注
微信扫一扫可直接关注哦!

flex笔记

容器属性
控制排序 flex-direction:row|row-reverse|column|column-reverse
是否换行 flex-wrap:Nowrap|wrap|wrap-reverse
简写flex-direction和flex-wrap: flex-flow:row Nowrap
在横轴对齐方式 justify-content:flex-start|flex-end|center|space-between|space-around|space-evenly
在纵轴排列方式 align-items:stretch(高度为auto,占满容器)|flex-start|flex-end|center(垂直居中)|baseline
多行项目排列align-content :stretch | flex-start | flex-end | center | space-between | space-around | space-evenly
注:如果我们修改了flex-direction为column,它们处理的轴向会交换,也就是justify-content处理纵轴,align-items处理横轴。
项目属性
order:认0,数值越小越靠前
flex-grow:认0不放大,改为1就放大到填满空间
flex-shrink:认1,认都等比缩小,设置0时不缩小
缩写 flex:认0 1 auto是flex-grow,flex-shrink与flex-basis的简写
align-self:auto(认) | flex-start | flex-end | center | baseline | stretch,表示继承父容器的align-items属性。如果没父元素,则认stretch。

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 [email protected] 举报,一经查实,本站将立刻删除。

相关推荐