关于flex元素超出父元素的解决方法

左边是label, 右边是input。 设置父级为display:flex; input为flex:1;

然后label 为 white-space: nowrap; 这时input就有可能超出父级。 

解决方法是把input设置为width:0;就可以了;

转载于: https://www.cnblogs.com/Red-ButterFly/p/8794286.html

posted @ 2022-06-25 11:06  haha-uu  阅读(685)  评论(0编辑  收藏  举报