css3 - 关于display: -webkit-box;下的-webkit-box-flex: 1。实际效果宽度并不是1:1
迷茫
迷茫 2017-04-17 11:26:34
0
2
687

如下代码
http://jsbin.com/cavusimoto/edit?html,css,output

简单的一行两列,用的-webkit-box-flex: 1
那么2列的宽度应该都是50%,可是实际情况是,文字多的那一列,宽度会更多一点。为什么呢?

迷茫
迷茫

业精于勤,荒于嬉;行成于思,毁于随。

reply all(2)
刘奇

Just add width: 0;, those who add -webkit-box-flex: 1;

伊谢尔伦

-webkit-box-flex: 1 means that the ratio of allocating the remaining width of the parent container is 1:1, not the total width of the parent container. If you write more content on the second sub-element, the effect will be obvious:

<p class="bb">1122234411222344112223441122234411222344</p>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template