IE7\8 不能很好地处理 Sprites On 输入?
我正在使用 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 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
出现“红色 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 :-).
请尝试从 CSS 代码更改背景部分:
我认为这是 CSS 解析问题
Please try to change the background part from CSS code:
I think it is a CSS parsing problem