關於flex元素超出父元素的解決方法

左邊是label, 右邊是input。 設置父級爲display:flex; input爲flex:1;flex

而後label 爲 white-space: nowrap; 這時input就有可能超出父級。 spa

解決方法是把input設置爲width:0;就能夠了;input

相關文章
相關標籤/搜索