如果遇到浏览器不给力,不兼容flex 怎么整???
网上搜到这么个文章,记录在此以便后用.
转载地址
flex-direction
- row
Displays items horizontally
.item { |
- row-reverse
Displays items horizontally in reverse order
.container { |
- column
Displays items vertically
.item { |
- column-reverse
Displays items vertically in reverse order
.container, .item { |
flex-wrap
- nowrap
Squishes items to stop wrapping
.container { |
- wrap
Wraps items when altogether wider than container
.item { |
- wrap-reverse
Wraps items in reverse order when altogether wider than container
.container, .item { |
justify-content
- flex-start
Horizontally aligns items to start of container
.item { |
- flex-end
Horizontally aligns items to end of container
.container { |
- center
Horizontally aligns items to center of container
.container { |
- space-between
Spaces items between start and end of container
.container { |
Note: This method only works with uncompressed HTML and requires a fixed height on the container
- space-around
Spaces items with equidistant space
.container { |
align-items
- flex-start
Vertically aligns items to start of container
.item { |
- flex-end
Vertically aligns items to end of container
.container { |
- center
Vertically aligns items to center of container
.container { |
- stretch
Vertically stretches items from start to end of container
.item { |
align-content
- flex-start
Vertically aligns items to start of container
.item { |
- flex-end
Vertically aligns items to end of container
.container { |
- center
Vertically aligns items to center of container
.container { |
flex items
- flex-grow
Grows an item to fill remaining space
.container { |
- flex-shrink
Shrinks an item and other items fill remaining space
.container { |
- align-self
Vertically aligns an item (bottom in this example)
.container { |