IE7\8 不能很好地处理 Sprites On 输入?

发布于 2024-09-06 05:05:55 字数 733 浏览 3 评论 0原文

我正在使用 css sprite 技术将网站上的所有按钮保存在一张 PNG 图像中。

此技术在普通样式按钮上的所有浏览器上都可以正常工作,但是对于 IE 7/8,它会在我使用 css 类定义图像的任何输入上显示边框和红色 x。这种技术对于 Firefox 来说效果很好。

我在这里错过了什么吗?

HTML:

http://img85.imageshack.us/img85/7493/spriteerrorhtml.png< /a>

CSS:

http://img514.imageshack.us/img514/1382/spriteerrorcss .png

比较:

http://img99.imageshack.us/img99/ 3251/spriteerrorcomparison.png

I'm using the css sprite technique to hold all the buttons on the site in one PNG Image.

This technique works fine on all browsers on your normal Style Buttons, however for IE 7/8 it shows a border and a red x on any input where I use a css class to define the image. This technique works fine for Firefox.

Am I missing something here ?

HTML:

http://img85.imageshack.us/img85/7493/spriteerrorhtml.png

CSS:

http://img514.imageshack.us/img514/1382/spriteerrorcss.png

Comparison:

http://img99.imageshack.us/img99/3251/spriteerrorcomparison.png

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

ヤ经典坏疍 2024-09-13 05:05:55

出现“红色 X”是因为 IMG 元素没有 SRC(或 SRC 中指定的无效/不可用资源)。

您可以使用透明的“存根”图像来解决该问题。另外,请确保在 IMG 上也设置 BORDER=0(猜猜为什么:-)。

The "red X" occurs because there is no SRC (or an invalid/not-available resource specified in the SRC) for the IMG element.

You can use a transparent "stub" image to fix that issue. Also, make sure to set BORDER=0 on the IMG as well (guess why :-).

微凉徒眸意 2024-09-13 05:05:55

请尝试从 CSS 代码更改背景部分:

background: url('XXXXXXXX.png')  no-repeat

我认为这是 CSS 解析问题

Please try to change the background part from CSS code:

background: url('XXXXXXXX.png')  no-repeat

I think it is a CSS parsing problem

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文