1
2
3
版本:CSS3
CSS flex-wrap
指定 flex 元素单行显示还是多行显示。如果允许换行,这个属性允许你控制行的堆叠方向。
flex-wrap: nowrap; /* default value */ flex-wrap: wrap; flex-wrap: wrap-reverse; /* global values */ flex-wrap: inherit; flex-wrap: initial; flex-wrap: unset;
IE11以上版本的浏览器都支持flex-wrap |
flex-direction
的值相当于start或before。flex-direction
的值选择等于start或before。cross-end为确定的cross-start的另一端。该属性控制flex容器是单行或者多行,同时横轴的方向决定了新行堆叠的方向。
默认值 | nowrap |
适用于 | flex容器 |
继承性 | 无 |
动画性 | visual |
计算值 | 指定值 |
//HTMLthis is an example for flex-wrap:wrap
123this is an example for flex-wrap:nowrap
123this is an example for flex-wrap:wrap-reverse
//CSS /* common styles */ .content, .content1, .content2 { color: #fff; font: 100 24px/100px sans-serif; height: 150px; text-align: center; } .content div, .content1 div, .content2 div { height: 50%; width: 50%; } .red { background: orangered; } .green { background: yellowgreen; } .blue { background: steelblue; } /* flexbox styles */ .content { display: flex; flex-wrap: wrap; } .content1 { display: flex; flex-wrap: nowrap; } .content2 { display: flex; flex-wrap: wrap-reverse; }123
鹏仔微信 15129739599 鹏仔QQ344225443 鹏仔前端 pjxi.com 共享博客 sharedbk.com
图片声明:本站部分配图来自网络。本站只作为美观性配图使用,无任何非法侵犯第三方意图,一切解释权归图片著作权方,本站不承担任何责任。如有恶意碰瓷者,必当奉陪到底严惩不贷!