hooyantsing's Blog

P119_19_弹性元素组规则合定义

字数统计: 80阅读时长: 1 min
2020/04/16

P119 19 弹性元素组规则合定义

flex

[对弹性元素设置]

f02dcd93092b2a02472ea3b8bd89778c.png

1
2
3
4
5
flex-grow: 1;
flex-shrink: 2;
flex-basis: 100px;
//相当于
flex: 1 2 100px;

flex-grow和flex-shrink区别

flex-grow小于弹性容器,0保持默认,x倍数增大。

flex-shrink大于弹性容器,0保持默认,x倍数缩小。

CATALOG