Flex:1;white-space:nowrap时,随着文字的越来越多,固定宽度的那一块会越来越小的原因和解决办法

122 阅读1分钟

?原因:

A flex item cannot be smaller than the size of its content along the main axis. The defaults are...
min-width: auto
min-height: auto
...for flex items in row-direction and column-direction, respectively.

解决:

You can override these defaults by setting flex items to: • min-width: 0min-height: 0overflow: hidden (or any other value, except visible)

来自 stackoverflow.com/questions/3…