当 flex
取值为一个非负数字,则该数字为 flex-grow
值,flex-shrink
取 1,flex-basis
取 0%,如下是等同的:
.item {flex: 1;} .item { flex-grow: 1; flex-shrink: 1; flex-basis: 0%; }
当 flex
取值为 auto
,则计算值为 1 1 auto,如下是等同的:
.item {flex: auto;} .item { flex-grow: 1; flex-shrink: 1; flex-basis: auto; }
当 flex
取值为 none
,则计算值为 0 0 auto,如下是等同的:
.item {flex: none;} .item { flex-grow: 0; flex-shrink: 0; flex-basis: auto; }