Opera Turbo 和背景重复不起作用
例如我有这样的代码:
<style>
body {
background: url('back.png') repeat-y center;
}
</style>
<body>
</body>
它在所有浏览器中都可以正常工作,包括 Opera。看起来像这样:
但是如果打开 Opera Turbo 模式,则看起来像这样:
这是为什么,可以修复吗? Ubuntu 10.10 上的 PS Opera 11.10
For example I have such a code:
<style>
body {
background: url('back.png') repeat-y center;
}
</style>
<body>
</body>
It works fine in all browsers, include Opera. Looks like this:
But if Opera Turbo mode is turned on, than it looks like this:
Why is this, and can it be fixed?
P.S. Opera 11.10 on Ubuntu 10.10
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
要找出为什么您的图像有时在 Opera Turbo 中看起来很混乱,您应该了解 Opera Turbo 的工作原理(实际上,什么是 Turbo 模式)。
如您所知,Opera Turbo 对于慢速连接来说非常方便。为了提高网页的加载速度,Opera Turbo 会压缩其内容。数据量越小意味着加载速度越快。
您的图像存在此问题的根源。
根据文件
因此,当您尝试使用 Turbo 模式访问某些页面时,Opera 服务器会从原始位置获取数据(下载完整的网页),在服务器端对其进行压缩并将其发送给您(或任何其他 Turbo 的客户端)。
是的,在 Turbo 模式下您看到的图像不是原始图像,那只是来自 Opera 服务器的压缩图像。
如果您想模拟此问题,请尝试使用 Photoshop(或任何其他照片编辑器)将该 PNG 图像转换为压缩的 JPEG 格式,您将得到与 Opera Turbo 中的示例类似的内容。
带宽优化
在 Turbo 模式下,您的图像会以低图像质量设置进行压缩(我猜是 1-5)。这使得它们的尺寸更小(图像质量显着下降)并且提高了加载速度。
这是 Opera Turbo 的主要目的!
这是对您问题“为什么是这样”的第一部分的回答。 “可以修复吗”部分的答案是不,无法修复。为什么?因为 Opera 在 Turbo 模式下的工作方式与任何其他普通浏览器不同。
Another quote:
在 CrazyEngineers 论坛上我也发现了这个......
这与您遇到的问题完全相同。
References:
To find why your images sometimes look like a mess in Opera Turbo, you should learn how Opera Turbo works (actually, what is Turbo mode).
As you know, Opera Turbo comes very handy for slow connections. To increase loading speed of web pages Opera Turbo compresses it's content. Smaller amount of data means quicker load.
There's root of this issue with your images.
According to documentation
So when you try to access some page using Turbo mode, Opera server takes data from original location (downloads complete webpage), compresses it on server side and send it compressed to you (or to any other Turbo's client).
Yeah, in Turbo mode image you can see is not original image, that's just compressed image from Opera server.
If you want to simulate this issue, try to convert that PNG image with Photoshop (or any other photo editor) into compressed JPEG format and you'll get something similar to your example from Opera Turbo.
Bandwidth optimization
In Turbo mode your images are compressed with low image quality setting (I guess 1-5). That makes them smaller size (with significant image quality loss) and that increases loading speed.
It is main purpose of Opera Turbo!
That was answer to first part of your question "Why is this". Answer on "can it be fixed" part is No, it can't be fixed. Why? Because Opera in Turbo mode doesn't work like any other normal browser.
Another quote:
On CrazyEngineers forum I also found this...
That's exact same issue like this one you have.
References:
Wh1T3h4Ck5 所说的确实是正确的,但可能有一个解决方案可以解决您的问题:尝试使您的图像图块非常小(无论是像素还是文件大小)并沿 x 和 y 轴重复它 - 这样,就没有什么收获进一步压缩,并且 Opera Turbo 有可能会掩盖它并且不再尝试进一步压缩它,从而保留预期的效果。
或者,您可以尝试使用 SVG 重新创建图像,它根本不会被压缩 - 但是,值得注意的是,并非所有浏览器都支持将 SVG 设置为背景图像。
What Wh1T3h4Ck5 said is indeed correct, but there might be a solution for your problem: try making your image tile very small (both in pixels and file size) and repeat it along the x and y axis - that way, little can be gained from further compression, and there is a chance Opera Turbo will gloss over it and not try to compress it any further, hence preserving the intended effect.
Alternatively, you can try recreating the image using SVG, which will not be compressed at all - however, it's worth noting that not all browsers support setting SVG as a background image.