参考答案:
flex 是 flex-grow, flex-shrink 和 flex-basis的简写。
除了auto (1 1 auto) 和 none (0 0 auto)这两个快捷值外,还有以下设置方式:
1.item {flex: 1;} 2.item { 3 flex-grow: 1; 4 flex-shrink: 1; 5 flex-basis: 0%; 6}
1.item {flex: 0;} 2.item { 3 flex-grow: 0; 4 flex-shrink: 1; 5 flex-basis: 0%; 6}
1.item-1 {flex: 0%;} 2.item-1 { 3 flex-grow: 1; 4 flex-shrink: 1; 5 flex-basis: 0%; 6} 7 8.item-2 {flex: 24px;} 9.item-2 { 10 flex-grow: 1; 11 flex-shrink: 1; 12 flex-basis: 24px; 13}
1.item {flex: 2 3;} 2.item { 3 flex-grow: 2; 4 flex-shrink: 3; 5 flex-basis: 0%; 6}
.item {flex: 11 32px;}
.item {
flex-grow: 11;
flex-shrink: 1;
flex-basis: 32px;
}
最近更新时间:2024-08-10