收藏
回答

Css transform 覆盖上层元素?

<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);
}
回答关注问题邀请回答
收藏
登录 后发表内容