首页 > 开发 > CSS > 正文

CSS3 Flexbox中flex-shrink属性的用法示例介绍

2024-07-11 08:51:54
字体:
来源:转载
供稿:网友
在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的压缩比例, 请看下面的示例:


复制代码
发表评论 共有条评论
用户名: 密码:
验证码: 匿名发表