解决手机UC浏览器图片不显示问题

今天做手机项目中,一个轮播图片,在其他手机浏览器没问题,但是到了UC浏览器就有问题了,经过站长逐步排查,发现UC浏览器自带了广告过滤,

在UC浏览器设置里面将广告过滤关闭即可,但是这不是唯一解决方案。

后来我发现,uc手机浏览器会过滤包含ad字符的图片路径,禁止其显示,所以给图片命名或存放图片路径时 尽量不要含有ad字符。如ad_img

所以站长代码原来是这样的:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
< section  class = "ads"  style = "top: -860px;" >
     < div  class = "ad_1"  style = "height: 430px; background-size: 320px 430px;" >
     < img  src = "/Public/mobile/images/member_login/ad1.jpg"  style = "width: 320px; height: 430px;" >
     </ div >
     < div  class = "ad_2"  style = "height: 430px; background-size: 320px 430px;" >
     < img  src = "/Public/mobile/images/member_login/ad2.jpg"  style = "width: 320px; height: 430px;" >
     </ div >        
     < div  class = "ad_3"  style = "height: 430px; background-size: 320px 430px;" >
     < img  src = "/Public/mobile/images/member_login/ad3.jpg"  style = "width: 320px; height: 430px;" >
     </ div >
     < div  class = "ad_4"  style = "height: 430px; background-size: 320px 430px;" >
     < img  src = "/Public/mobile/images/member_login/ad4.jpg"  style = "width: 320px; height: 430px;" >
     </ div >
     < div  class = "ad_5"  style = "height: 430px; background-size: 320px 430px;" >
     < img  src = "/Public/mobile/images/member_login/ad5.jpg"  style = "width: 320px; height: 430px;" >
     </ div >  
          
</ section >

后来修改这样就显示了:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
< section  class = "ads"  style = "top: -860px;" >
     < div  class = "img_1"  style = "height: 430px; background-size: 320px 430px;" >
     < img  src = "/Public/mobile/images/member_login/img1.jpg"  style = "width: 320px; height: 430px;" >
     </ div >
     < div  class = "img_1"  style = "height: 430px; background-size: 320px 430px;" >
     < img  src = "/Public/mobile/images/member_login/img2.jpg"  style = "width: 320px; height: 430px;" >
     </ div >        
     < div  class = "img_1"  style = "height: 430px; background-size: 320px 430px;" >
     < img  src = "/Public/mobile/images/member_login/img3.jpg"  style = "width: 320px; height: 430px;" >
     </ div >
     < div  class = "img_1"  style = "height: 430px; background-size: 320px 430px;" >
     < img  src = "/Public/mobile/images/member_login/img4.jpg"  style = "width: 320px; height: 430px;" >
     </ div >
     < div  class = "img_1"  style = "height: 430px; background-size: 320px 430px;" >
     < img  src = "/Public/mobile/images/member_login/img5.jpg"  style = "width: 320px; height: 430px;" >
     </ div >  
          
</ section >

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值