众所周知,flex
属性是flex-grow
、flex-shrink
和的简写flex-basis
属性。它的默认值为0 1 auto
,即
flex-grow: 0;
flex-shrink: 1;
flex-basis: auto;
但我注意到,在很多地方都使用了 flex: 1
。它是 1 1 auto
还是 1 0 auto
的简写?我不明白这意味着什么,当我用谷歌搜索时我什么也得不到。
最佳答案
flex: 1
表示如下:
flex-grow : 1; ➜ The div will grow in same proportion as the window-size
flex-shrink : 1; ➜ The div will shrink in same proportion as the window-size
flex-basis : 0; ➜ The div does not have a starting value as such and will
take up screen as per the screen size available for
e.g:- if 3 divs are in the wrapper then each div will take 33%.
关于css - flex : 1 mean? 是什么,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/54727060/