scroll-view is used in Mini Program to achieve the left and right sliding effect. The code is roughly as follows
wxml:
<scroll-view scroll-x="true" class="container-body">
<view class="container-body-box">
<view><image src="../../images/tupian.png"></image></view>
<view class="tips"><text></text></view>
<view class="tips"><text></text></view>
<view class="tips"><text></text></view>
<view class="tips"><text></text></view>
<view><button class="buy"></button></view>
<view class="tips"><text></text></view>
</view>
<view class="container-body-box">2</view>
<view class="container-body-box">3</view>
<view class="container-body-box">4</view>
</scroll-view>
wxss
.container-body {
width: 100%;
height: 990rpx;
overflow: hidden;
margin: 0 auto;
position: relative;
top:-120rpx;
text-align: center;
white-space:nowrap;
}
.container-body-box {
width: 90%;
height: 990rpx;
background:-sharpfff;
margin: 0rpx 5%;
border-radius: 10rpx;
display: inline-block;
}
.tips
width: 90%;
margin: 0 auto;
}
the problem: as shown in the picture, the view in the back (2Jing 3jin4) has all been squeezed down. How high the content in 1 is, how much it will be squeezed in the back. What went wrong?