柔性盒/网格布局中的最后边距/填充折叠
我有一个列表的项目,我试图安排成一个滚动的水平布局与柔性盒。
容器中的每一项都有左边和右边,但最后一项的右边距正在折叠。
有什么办法阻止这种情况发生,还是有一个好的解决办法?
ul {
list-style-type: none;
padding: 0;
margin: 0;
display: flex;
height: 300px;
overflow: auto;
width: 600px;
background: orange;
}
ul li {
background: blue;
color: #fff;
padding: 90px;
margin: 0 30px;
white-space: nowrap;
flex-basis: auto;
}
<div class="container">
<ul>
<li>Item 1</li>
<li>Item 2</li>
<li>Item 3</li>
<li>Item 4</li>
</ul>
</div>
慕少森
猛跑小猪