首页 > 微信 > 详细

微信小程序图片有间隙

时间:2021-05-12 20:52:30      阅读:43      评论:0      收藏:0      [点我收藏+]

一、原本有间隙

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

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!