flex-shrink

Introduction

Defines the shrink factor of the flex element on the main axis. After the flex container layout elements, if there is an element overflow, the corresponding element will be scaled according to the element's zoom factor ratio to ensure that the element will not overflow the container.

Examples

Syntax

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

Values

  • <number>

    Negative values are invalid. Defaults to 1.

Formal definition

Initial value1
Applies toflex items
Inheritedno
Animatable

Formal syntax

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

Compatibility

LCD tables only load in the browser

Except as otherwise noted, this work is licensed under a Creative Commons Attribution 4.0 International License, and code samples are licensed under the Apache License 2.0.