CSS 背景大小 :cover getting blurry and dull in Chrome

标签 css google-chrome internet-explorer

我经常有这种感觉,设置为 background-size:cover(在 div 上)的图像在 Google Chrome 中看起来不清晰锐利。

这是我使用的 CSS。

.slide {
    width:1280px;
    height:400px;
    background-image:url(background.jpg);
    -webkit-background-size: cover!important;
    -moz-background-size: cover!important;
    -o-background-size: cover!important;
    background-size: cover!important;
    background-position:center center;
    background-repeat:no-repeat;    
}

在此处查看实时示例:http://www.wovenplus.com/test/

只需在 Chrome 和 IE 中比较上面的链接。在我的例子中,在 Chrome 中,图像看起来模糊而暗淡,而在 IE 中,它看起来清晰锐利。 (仔细观察靠垫的叶子或顶部,或在 Chrome 和 IE 窗口之间切换以查看差异)。

有人也注意到了吗?有什么解决办法吗?

最佳答案

尝试将此添加到代码中: 图像渲染:-webkit-optimize-contrast; 对我来说,它完美地完成了任务。

关于CSS 背景大小 :cover getting blurry and dull in Chrome,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/35141504/

相关文章:

css - 字体不会在 IE 中呈现

html - 输入渲染文本大于 CSS 中定义的大小

html - 页脚 Div 位置错误

google-chrome - Chrome 80 POST from Flash : no cookies, Origin null(非跨站点)

css - 背景图片在手机上放大太多

twitter-bootstrap - IE 11 中的 css 表格单元格不必要的填充

jquery - 使用 jQuery 和 Ajax.BeginForm 将 div 与 "Loading..."spinner.gif 居中

javascript - 我不明白以下javascript

javascript - 应用旋转后,HTML5 canvas clip() 在 Chrome 中不起作用

html - 如何在 <IE8 中嵌入 block ?