赞
踩
<div style="width: 1000px;overflow: auto;display: flex;border: 1px solid black">
<div style="width: 500px;height: 100px;background-color: red;">1</div>
<div style="width: 500px;height: 100px;background-color: green;">2</div>
<div style="width: 500px;height: 100px;background-color: blue;">3</div>
<div style="width: 500px;height: 100px;background-color: orange;">4</div>
<div style="width: 500px;height: 100px;background-color: pink;">5</div>
</div>
在给他子元素不加flex-shrink且父盒子中不加flex-wrap=“wrap”的情况下,超出父盒子的宽度,父盒子会自动压缩子盒子的宽度。
当给子盒子加上flex-shrink: 0,子盒子不会被压缩宽度;
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。