小编Eth*_*n C的帖子

我不理解flex-grow属性吗?

我恐怕不能理解弹性增长.如果你跳到下面的JSFiddle - 我理解它的方式,.big应该是另一个的三倍.flex-item.如你所见,不是这样.为什么?

http://jsfiddle.net/nrur6mmo/

.flex-container {
    display:flex;
    padding:0 20%;
}
.flex-item {
    flex-grow:1;
    list-style-type:none;
    border:1px solid black;
}
.big {
    flex-grow:3;
}
Run Code Online (Sandbox Code Playgroud)
<ul class="flex-container">
    <li class="flex-item big">Why isn't this exactly three times the size of the other one?</li>
    <li class="flex-item">Not really working like expected I don't think...</li>
</ul>
Run Code Online (Sandbox Code Playgroud)

css flexbox flex-grow

43
推荐指数
3
解决办法
3万
查看次数

标签 统计

css ×1

flex-grow ×1

flexbox ×1