微信小程序图片有间隙

一、原本有间隙

1.wxml

<view class="picture" wx:for="{{product}}">
<image class="img" src="{{item}}" mode="widthFix"></image>
</view>

2.wxss

.img{
width: 100%;
}

3.原图

 二、修改后(两种都可以)

1.wxss

①、

.picture image {
width: 100%;
min-height: 500rpx;
}
.img {
width: 100%;
position: relative;
display: flex;
flex-direction: column;
}

②、

.picture image {
width: 100%;
min-height: 500rpx;
margin-top: -12rpx;
}
.img {
position: relative;
}

2.修改后的图片

微信小程序图片有间隙

原文:https://www.cnblogs.com/ki16/p/14761045.html

以上是微信小程序图片有间隙的全部内容。
THE END
分享
二维码
)">
< <上一篇
下一篇>>