html - 图片在 Chrome 中看起来分辨率低且模糊

标签 html css google-chrome

我注意到我网站上的一些图片在 Chrome 中看起来分辨率低,而在 Mozilla 中看起来不错。

这里是截图

在 Chrome 中: enter image description here

在 Mozilla 中: enter image description here

我该怎么做才能解决这个问题?

我找到了类似的东西,但没有帮助

img {
     image-rendering: optimizeSpeed;             /*                     */
    image-rendering: -moz-crisp-edges;          /* Firefox             */
    image-rendering: -o-crisp-edges;            /* Opera               */
    image-rendering: -webkit-optimize-contrast; /* Chrome (and Safari) */
    image-rendering: optimize-contrast;         /* CSS3 Proposed       */
    -ms-interpolation-mode: nearest-neighbor;   /* IE8+                */
}

这是我添加图像渲染时的样子:像素化; enter image description here

最佳答案

Chrome 似乎做了一些抗锯齿处理。因此,首先,它可能有助于将图片保存为所需的大小(当您不应用任何大小时它会正确显示,例如使用 CSS)。然后,根据CanIUse ,对于 Chrome,CSS 应该读取 image-rendering: pixelated; 而不是 image-rendering: -webkit-optimize-contrast; 注意:Safari 的值也发生了变化,MS 不再/在 Edge 中支持它。

关于html - 图片在 Chrome 中看起来分辨率低且模糊,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/31842316/

相关文章:

html - 居中容器并使宽度等于其 float 内容

html - 如何使用 HTML 和 CSS 创建链接图像悬停?

html - 将响应图像居中

javascript - 使用 jscript 级联(从上到下)div 的组织结构

javascript - 桌面上的 innerWidth 和 outerWidth 奇数

javascript - onPopState() 仅在 Google Chrome 中抛出错误

javascript - jQuery load() 函数更改输入文本的高度

html - 带有内嵌文本并停止文本换行的图像

google-chrome - google chrome什么时候支持1.1版本的远程调试协议(protocol)?

android - 如何使用 useragent css 定位 Samsung Galaxy Tab S3?