Css transform 覆盖上层元素?

如图

IMG_5213.jpg

<view class="flex-center tab_bar" catchtap="toClassify">
  <view class="flex-center to_class">
    <text>{{ranking.classify}}</text>
    <text class="iconfont iconfont-right"></text>
  </view>
</view>
.tab_bar {
  width: 460rpx;
  height: 140rpx;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  margin: 0 auto;
  z-index: 1;
}

.tab_bar::after {
  content: '';
  width: 460rpx;
  height: 140rpx;
  background: #FFFFFF;
  border-radius: 40rpx 40rpx 0 0;
  transform: perspective(40px) scale(0.9) rotateX(20deg);
  filter: drop-shadow(0px -10px 29px rgba(0, 0, 0, 0.07));
  box-sizing: border-box;
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  margin: 0 auto;
  z-index: 0;
}

.to_class {
  justify-content: center;
  font-size: 34rpx;
  font-weight: bold;
  color: #FA5136;
  position: absolute;
  left: 0;
  right: 0;
  bottom: 40rpx;
  margin: 0 auto;
  z-index: 9;
  transform: translateZ(1);
}
阅读 1.3k
撰写回答
你尚未登录,登录后可以
  • 和开发者交流问题的细节
  • 关注并接收问题和回答的更新提醒
  • 参与内容的编辑和改进,让解决方法与时俱进
推荐问题