使用表格的 CSS Sprite 按钮...无法摆脱 IE 中表格后的换行符(怪异模式)
我正在使用以下图像创建一个 css 按钮...
这是表格的背景.. 文本因为图像位于 td 块内。
您可以在这里看到它的实际效果,请查看源代码以了解它是如何工作的,CSS 是内联的。
一切似乎都工作得很好......但在 IE 中查看它并火狐。您会注意到,出于某种原因,IE 中存在换行符,而 Firefox 中则没有。我希望它没有换行符,firefox 风格。
我知道很多人会立即说“只需添加一个 DOCTYPE 标签,一切都会好起来的!” 不幸的是,我的用例是它必须在 IE 怪癖模式下工作。
那么..这是一个限制..有什么想法吗?
I am creating a css button using the following image...
This is the background of a table.. the text for the image goes inside td blocks.
You can see it in action here, please view source to see how it all works, css is in-lined.
Everything appears to be working great... but view it in IE and Firefox. You'll notice that for some reason there are line breaks in IE and not in Firefox. I want it to not have the line breaks, firefox style.
I know a lot of people will immediately say "Just add a DOCTYPE tag and all will be well!"
Unfortunately my use case is such that it has to work in I.E. quirks mode.
So..with that being a restriction.. any ideas?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您是否尝试将“
float:left;
”添加到CSS类“.spriteTableButton
”?这样可以立即解决断行问题。Did you try to add "
float:left;
" to css class ".spriteTableButton
" ? This can solve the problem of linebreak in no time.