收藏
回答

视频列表,图片叠加问题怎么会失败?

.container{
  flex-direction: column;
  display: flex;
  margin-top20rpx;
  margin-bottom40rpx;
  margin-left0rpx;
  background-color#fff;
  border-bottom1px solid #ededed;
  border-top1px solid #ededed;
  padding-bottom5px;
}
.VideoImage{
  /*position: relative;*/
  margin20rpx,20rpx,20rpx,20rpx;
  width80%;
  height:400rpx;
  border-radius20rpx;
  overflow: hidden;
  z-index: -1;
}
.play-btn{
  position: absolute;
  width50rpx;
  height50rpx;
  top50%;
  left50%;
  z-index100;
  
  /*transform: translateX(-50%) translateY(-50%);*/
}
我的两个css想实现图片叠加的效果来展示视频播放列表,一个是视频封面,一个是视频播放的按钮。
如果 在 VideoImage中选择使用position: relative,则视频列表的图片会排列的很诡异。
如果不用,两个图片是并列排布的,没有实现叠加效果。
求大神指导。
回答关注问题邀请回答
收藏

1 个回答

  • 微盟
    微盟
    2021-07-12

    flex + 负margin可以实现图片重叠

    2021-07-12
    有用
    回复
登录 后发表内容