背景图片自适应

<view class="videoBox">
  <view class="videoBox-text">
    <image src="https://xcx.hy720.com/wtt/videobtn.png"></image>
    <text>美食视频</text>
    <view>更多 ></view>
  </view>
  <scroll-view class="image-group" scroll-x="true">
    <view class="dingwei">
      <image class="aa"></image>   <!--背景图片关键代码-->
      <view class="volume">
        <image src="https://xcx.hy720.com/wtt/wzbtn.png" class="tubiao"></image>
        <text>6.8k</text>
      </view>
      <text class="dingwei-title">最走心的同学</text>
    </view>

    <view class="dingwei">
      <image class="aa" ></image> <!--背景图片关键代码-->
      <view class="volume">
        <image src="https://xcx.hy720.com/wtt/wzbtn.png" class="tubiao"></image>
        <text>6.8k</text>
      </view>
      <text class="dingwei-title">最走心的同学</text>
    </view>

    <view class="dingwei">
      <image class="aa" ></image> <!--背景图片关键代码-->
      <view class="volume">
        <image src="https://xcx.hy720.com/wtt/wzbtn.png" class="tubiao"></image>
        <text>6.8k</text>
      </view>
      <text class="dingwei-title">最走心的同学</text>
    </view>   
  </scroll-view>
</view>

 

page{background-color: #efefef;}
.image-group {
  display: flex;
  white-space: nowrap;
  margin-top: 30rpx;
  border-radius: 15rpx; 
}
.dingwei  {
  width: 240rpx;
  height: 320rpx;
  position: relative;
  display: inline-block;
  margin-right: 20rpx;
}
.aa{
  /* width: 100%;  
  height: 100%; */
  width: 240rpx;
  height: 320rpx;
  margin-right: 20rpx;
  border-radius: 10rpx;
/*背景图片关键代码*/
background: url(https://xcx.hyw.cc/mp/attachment/images/7/2019/08/pCFfAPqi5ii9H9EFe8fEHFHIFEia2c.jpg) no-repeat;
background-size: cover;
background-position: center center;
/*背景图片关键代码*/
}
.volume{display: flex;flex-wrap: wrap;width: 100rpx;height: 35rpx;border-radius: 20rpx;  background-color: rgba(3, 3, 3, 0.4);color: #fff;font-size: 24rpx;position: absolute;z-index: 9999; left: 135rpx; top: 10rpx;}
.volume .tubiao{width: 20rpx;height: 20rpx; margin-left: 10rpx;margin-top: 8rpx;margin-right: 3rpx;}
.volume text{width: 30rpx;height: 35rpx;line-height: 35rpx;}
.dingwei-title{width: 100%;top:270rpx;left: 10rpx; display: block;position: absolute;z-index: 9999;color: #fff;font-size: 24rpx;}
.videoBox{width: 94%;background-color: #fff;margin: 15rpx auto;border-radius: 20rpx;padding: 20rpx;}
.videoBox-text{display: flex;flex-wrap: wrap;padding-top: 10rpx; padding-left: 10rpx;}
.videoBox-text image{width: 50rpx;height: 50rpx;}
.videoBox-text text{width: 550rpx;height: 50rpx;line-height: 50rpx;padding-left: 10rpx;}
.videoBox-text view{width: 90rpx; height: 35rpx;line-height: 35rpx; background-color: #ffdc1c;border-radius: 20rpx;font-size: 20rpx;text-align: center;margin-top: 5rpx;}

 

转载于:https://www.cnblogs.com/chabuer/p/11562302.html

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值