For AI agents: the complete documentation index is available at /next/zh/llms.txt, the full documentation bundle is available at /next/zh/llms-full.txt, and this page is available as Markdown at /next/zh/api/css/properties/flex-shrink.md.
Lynx
  • 简体中文
  • flex-shrink

    介绍

    定义弹性项目在主轴的缩放系数。弹性容器将元件布局完后,如果存在元件溢出,会根据元件的缩放系数比例将对应的元件进行缩放保证元件不会溢出容器。

    使用示例

    语法

    /* <number> 值 */
    flex-shrink: 2;
    flex-shrink: 0;

    取值

    • <number>

      负值无效,0 表示不会缩放,默认值1

    形式定义

    初始值1
    适用元素flex items
    是否支持继承
    是否支持动画

    形式语法

    flex-shrink =
      <number [0,∞]>

    兼容性

    LCD tables only load in the browser

    除非另有说明,本项目采用知识共享署名 4.0 国际许可协议进行许可,代码示例采用 Apache License 2.0 许可协议进行许可。