Open Yang03 opened 9 years ago
.container {
display: flex;
}
flex 是一个简写
flex 1
/* == */
flex-grow:1;
flex-basis:auto;
flex-shrink: 1;
demo, 左右布局,右边元素固定宽度,左边flex
.container {
display: flex
}
.left {
flex: 1
}
.right {
width: 100px
}
flex-shrink: 2 //按照2x倍缩放容器, 默认是1
flex-nowrap: nowrap //(默认), wrap, wrap-reverse
flex-start
flex-end
flex-center
8fed-ac0586efd209.png)
space-between
space-around
space-evenly
strech
animation
flex
flex-direction定义主轴的方向
flex-wrap 定义flex项目是否换行显示
justify-content 定义了项目在主轴上的对齐方式
align-items 定义与水平方向垂直的对齐
order 数值越小,排列越靠前,默认值为0
flex-basis 定义元素占据的最小空间
flex-shrink 定义元素占据的缩小比例
flex-grow 定义元素占据的比例