背景图像未在 Safari 中显示 [英] Background image not showing in Safari

查看:23
本文介绍了背景图像未在 Safari 中显示的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在研究响应式设计,并且bgMainpage"类有一个背景图像,但它没有在所有设备的 Safari 上显示.我已经应用了背景尺寸封面,因为这是客户想要的.我也添加了浏览器特定的 CSS,但我不知道还能做什么,以便它也显示在 Safari 中.Chrome、FF、IE 显示图像就好.有什么想法吗?

I am working on a responsive design and the class "bgMainpage" is having a background image but it is not showing on Safari on all the devices. I have applied background size cover as it is what the client wants. I have added browser specific CSS too and I am not sure what else to do so that it shows up in Safari too. Chrome, FF, IE show the image just fine. Any ideas ?

项目链接

CSS:

.bgMainpage{
    background:url("../images/bg.jpg") no-repeat scroll right top #000000;
    -o-background-size: cover;
    -moz-background-size: cover;
    -webkit-background-size:cover;
    background-size: cover;
}

推荐答案

我将图像格式从 jpeg 转换为 gif 并且它起作用了.所以最终的 CSS 是:

I converted the image format from jpeg to gif and it worked. So the final CSS is :

.bgMainpage{
    background:url("../images/bg.gif") no-repeat scroll right top #000000;
    -o-background-size: cover;
    -moz-background-size: cover;
    -webkit-background-size:cover;
    background-size: cover;
}

这篇关于背景图像未在 Safari 中显示的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆