解决办法,父div设置min-width:0即可
flex: 1;
min-width: 0;
w3c上面是这样说的
by default, flex items won’t shrink below their minimum content size (the length of the longest word or fixed-size element).
因为设置了white-space:nowrap
,所以content没法收缩了,设置0后就有了固定尺寸就可以收缩了
记录走过的路,踩过的坑,互勉。
前端交流群:87709616
有不同意见的可以留言,我们一起讨论。
转载至:
如对本文有疑问, 点击进行留言回复!!
网友评论