


设置的父元素是400px,子元素是200px,为什么显示在页面中变成4等分,每个50px了,这样不能滚动了
删除scroll-view-H
scroll-view{ white ‐space: nowrap ; } scroll-view .scroll-view-item-H{ display : inline ‐ block ; } |
<scroll-view scroll-x style=“width:400rpx;white-space: nowrap;overflow: hidden;”>
<view style=“width:200rpx;height:80rpx;background:black;display:inline-block;”></view>
<view style=“width:200rpx;height:80rpx;background:green;display:inline-block;”></view>
<view style=“width:200rpx;height:80rpx;background:yellow;display:inline-block;”></view>
<view style=“width:200rpx;height:80rpx;background:red;display:inline-block;”></view>
</scroll-view>