处理安卓机不支持backdrop-filter毛玻璃效果样式

处理安卓机不支持backdrop-filter毛玻璃效果样式
方式一:
html:

<div>
    <main>
        <img class="bg" src="../../static/images/bg.png" alt="">
        <blockquote> “The only way to get rid of a temptation[…]” 
            <footer><cite> Oscar Wilde, The Picture of Dorian Gray </cite>
            </footer>
        </blockquote>
    </main>
</div>

css:

main { 
        width: 100vw;
        height: 100vh;
        position: relative;
        background: hsla(0,0%,100%,.3);
        overflow: hidden; 
     } 
    main::before { 
        // 就是不能图片直接毛玻璃 (图片有object-fit: cover;裁剪方式)
        background: url('../../static/images/bg.png') 0 / 100% 100% fixed rgba(77, 77, 77, 1); 
        content: '';
        position: absolute;
        top: 0;
        right: 0;
        bottom: 0;
        left: 0;
        filter: blur(30px);
        margin: -30px; 
     }

方式二:

<div class="robotMoodDetailPage">
        <img class="bg voideBgFilter" src="../../static/images/bg.png" alt="">
        <div class="robotMoodDetailPageCon">
        树大根深大哥
        </div>
</div>

.robotMoodDetailPage{
    width: 100vw;
    height: 100vh;
    background: rgba(77, 77, 77, 1);
    .bg {
        position: fixed;
        top: 0;
        width: 100vw;
        height: 100vh;
        object-fit: cover;
    }
    .voideBgFilter {
        background: inherit;
        -webkit-filter: blur(30px);
        -moz-filter: blur(30px);
        -ms-filter: blur(30px);
        -o-filter: blur(30px);
        filter: blur(30px);
        filter: progid:DXImageTransform.Microsoft.Blur(PixelRadius=4, MakeShadow=false);  /* ie6-9*/
    }
    .robotMoodDetailPageCon {
        position: relative;
        width: 100vw;
        height: 100vh;
        padding-top: 2.75rem;
        overflow: hidden;
        position: absolute;
        right: 0;
        bottom: 0;
        // background: inherit;
        overflow: hidden;
        color:#fff;
    }
}
  • 0
    点赞
  • 4
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值