IE 8特定的背景图像错误 [英] IE 8 specific background-image bug

查看:107
本文介绍了IE 8特定的背景图像错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个1px x 1px的灰色像素。它用作BG图像:

I have a 1px by 1px grey pixel. It is used as a BG image:

background-attachment:scroll;
background-color:transparent;
background-image:url("../image/vertical-border.png");
background-position:393px 0;
background-repeat:repeat-y;

所以我希望灰色的垂直线是div中最高的高度。常见的伎俩。

So I expect a grey, vertical line the height of whatever is tallest in the div. Common trick.

所以我在每个浏览器EXCEPT IE 8中正确地看到这一点。在IE 8中,它显示为渐变。黑暗的顶部,光从下面。这是多么疯狂?

So I see this properly in every browser EXCEPT IE 8. In IE 8 it displays as a gradient. Dark up top, light down below. How crazy is that? I've never seen anything like this, and would love some insight.

谢谢!

推荐答案

不幸的是,这是一个PNG渲染错误(惊喜惊喜),在大多数情况下,人们增加了平铺的PNG图像的大小说,10x10,问题被删除。希望这是确定的 - 可能使用1x10,甚至更好的1x50 ...

Unfortunately this is a PNG rendering bug (surprise surprise), in most cases people increase the size of the tiled PNG image to say, 10x10 and the problem is removed. Hopefully this is ok for you - perhaps use a 1x10, or even better a 1x50...

部分解释,从内存,是所需的处理量将它的过滤应用到1x1图像,当它乘以它出现在屏幕上的次数 - 它刚刚过于硬的IE。

A partial explanation, from memory, was the amount of processing required by IE to apply its filtering to 1x1 images, when you multiply it by the number of times it appears on the screen - its just too hardcore for IE.

请参阅: IE8的透明png的渲染在我的网站上是FUBAR的,和相关的帖子/评论。

See: IE8's rendering of transparent pngs is FUBARed on my site, and related posts/comments.

编辑:
嘿,因为它只是一条垂直线,可以只使用GIF格式吗?还是8位的,非alpha透明的PNG?

Hey, since it's just a vertical line, is it possible to just use GIF format instead? Or perhaps 8-bit, non alpha transparent PNG?

这篇关于IE 8特定的背景图像错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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