赞
踩
简单粗暴一点 直接上代码
WXML 代码
<view class="slide_r">
<view class="slideNav box">
<view class="slideNav_c">
<scroll-view class="categories" scroll-x="true" scroll-y="true" >
<view class="main">
<view>25</view>
<view>666</view>
<view>4545</view>
</view>
</scroll-view>
</view>
</view>
</view>
WXSS 代码
.slide_r{ width: 95%; height: 300rpx; border: 1rpx solid rgb(156, 25, 25); } .slideNav{ margin: auto; width: 100%; height: 100%; border-bottom-right-radius: 20rpx; border-bottom-left-radius: 20rpx; overflow:auto; overflow-y:auto; } .slideNav_c{ position: relative; width: 100%; height: 100%; } .categories{ position: absolute; margin: auto; width: 1000rpx; height: 200rpx; line-height: 80rpx; white-space: nowrap; display: flex; border: 1rpx solid rebeccapurple; } ::-webkit-scrollbar{ width: 0; height: 0; color: transparent; } .main{ width: 100%; height: 100%; display: flex; } .main view:nth-child(1){ width: 200rpx; height: 100rpx; background-color: saddlebrown; } .main view:nth-child(2){ width: 200rpx; height: 100rpx; background-color: red; } .main view:nth-child(3){ width: 200rpx; height: 100rpx; background-color: darkseagreen; }
赞
踩
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。