flexbox布局

127 阅读1分钟

 1.flex-container:       属性                                       属性值 flex-direction(主轴方向)                  row(默认为行)                                         row-reverse                                         column                                         column-reverse  flex-wrap(是否换行)                       wrap                                         nowrap                                         wrap-reverse  justify-content(item在主轴上的排列规则     flex-start                                         flex-end                                         center                                         space-between  (分散开,两边紧挨着)                                         space-around  (item两边同等边距,两个item中间为二倍边距)  align-items ( item在cross轴上的分布规则)        stretch(默认拉伸)                                              flex-start                                              flex-end                                              center                                              baseline    align-content(多条轴线的排列规则)               stretch                                               flex-start                                               flex-end                                               center                                               space-between                                               space-around   flex-direction和flex-wrap 可以简写为flex-flow 
2.flex-item order         item的一个排序,数值越大排的越后  flex-grow     将剩余空间按比例分配flex-shrink   将超出空间按比例压缩:0为不压缩flex-basis    设置item的宽度,比width的权重高flign-self    设置单个item在cross轴的对齐方式,可以覆盖align-itemsflex-grow flex-shrink flex-basis 可以简写为flex