css解决苹果手机底部凹槽问题

问题:


image.png

解决后:
image.png
<div class="footer-block">
  <div class="ios-bottom"><div>
</div>

      .footer-block {
        width: 100vw;
        height: 100rpx;
        position: fixed;
        left: 0;
        // bottom: 0;
        bottom: 0rpx;
        bottom: constant(safe-area-inset-bottom);
        bottom: env(safe-area-inset-bottom);
        z-index: 199;
        overflow: inherit;
    }
        //底部设置个底块,填充空白
      .ios-bottom{
        width: 100vw;
        height: constant(safe-area-inset-bottom);
        height: env(safe-area-inset-bottom);
        position: fixed;
        bottom: 0rpx;
        z-index: 199;
        background-color: $theme-color;
        box-sizing: inherit;
        border-top: 1rpx solid #efefef;
    }
©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

推荐阅读更多精彩内容