Open rogerxu opened 7 years ago
Define a parent element as a Flex Container
.flex-container {
display: flex;
}
flex-direction
+ flex-wrap
Based on flex-direction
: row
(default) or column
.
flex-direction
flex-wrap
justify-content
align-items
on flex-container
All child elements become Flex Items
.flex-item {
flex: 2 0 250px;
}
<integer>
<number>
<number>
flex-grow
flex-shrink
flex-basis
align-items
order
: 0 based index value
0
- both content and available space100px
- initial widthauto
- only available space
Flex 布局教程:语法篇 - 阮一峰的网络日志 (ruanyifeng.com)
A Complete Guide to Flexbox | CSS-Tricks
Flexbox - Learn web development | MDN