1. 程式人生 > >CSS Flexbox 彈性盒子模型

CSS Flexbox 彈性盒子模型

items bsp basic tag none flexbox flex between cti

CSS Flexbox 彈性盒子模型

設置元素樣式為 display: flex 或 display: inline-flex, 讓元素變成flex容器, 從而可以通過flex模式布局它的子元素.

flex-direction:

值    row | row-reverse | column | column-reverse
默認值   row

flex-wrap:

值    nowrap | wrap | wrap-reverse
默認值  nowrap

flex-flow:

值    <flex-direction> ‖ <flex-wrap>
默認值  row nowrap

Flex子對象分布

justify-content:

值    flex-start | flex-end | center | space-between | space-around |space-evenly
默認值   flex-start

align-items:

值    flex-start | flex-end | center | baseline | stretch
默認值  stretch

align-self:

值    auto |flex-start | flex-end | center | baseline | stretch
默認值  auto

align-content:

值    flex-start | flex-end | center | space-between | space-around |space-evenly | stretch
默認值  stretch

flex-grow:

值    <number>
默認值  0

flex-shrink:

值    <number>
默認值  1

flex-basic: <width>

值    auto | <length> | <percentage>
默認值  auto

flex:

值    [ <flex-grow> <flex-shrink>? ‖ <flex-basis> ] | none
默認值  0 1 auto

CSS Flexbox 彈性盒子模型