本文主要包含CSS3,Flexbox,flex-shrink等相关知识,佚名 希望在学习及工作中可以帮助到您
在CSS3 Flexbox中flex-shrink属性定义为:
This <number> component sets ‘flex-shrink’ longhand and specifies the flex shrink factor, which determines how much the flex item will shrink relative to the rest of the flex items in the flex container when negative free space is distributed. When omitted, it is set to ‘1’. The flex shrink factor is multiplied by the flex basis when distributing negative space.
通俗来讲就是当flex items的大小超过了flex container时, 各个flex item的压缩比例, 请看下面的示例:
根据以上结果可知flex-shrink值越大,flex item的实际结果就会越小
This <number> component sets ‘flex-shrink’ longhand and specifies the flex shrink factor, which determines how much the flex item will shrink relative to the rest of the flex items in the flex container when negative free space is distributed. When omitted, it is set to ‘1’. The flex shrink factor is multiplied by the flex basis when distributing negative space.
通俗来讲就是当flex items的大小超过了flex container时, 各个flex item的压缩比例, 请看下面的示例:
根据以上结果可知flex-shrink值越大,flex item的实际结果就会越小