Internet Explorer:断下划线
我在使此布局在 IE 中正常工作时遇到一些问题。 问题是,当我有一些小型大写字母、带下划线的文本时,垂直对齐设置为中间的图像会破坏下划线。 小写字母的下划线向下移动。 查看图片。
这在 Firefox、Chrome 和 Opera 中看起来不错,但它是我尝试过的每个 IE 版本(包括 8)都出现了问题。带下划线的链接也会出现这种情况。 这是代码:
<html>
<head>
<title>Test</title>
<style type="text/css">
img { vertical-align: middle; }
span { text-decoration: underline; font-variant: small-caps; }
</style>
</head>
<body>
<img src="pic.png">
<span>Abc QWerty AbCdEfGhIjKlMnOpQrStUvWxYz1234567890</span>
</body>
</html>
感谢您的任何建议。
I'm having some trouble getting this layout to work correctly in IE. The problem is that when I have a bit of small-caps, underlined text, an image with vertical-align set to middle breaks up the underline. Lower case letters have their underline shifted down. See the picture.
This looks fine in Firefox, Chrome and Opera, but it's broken in every version of IE that I tried, including 8. This happens for underlined links as well. Here's the code:
<html>
<head>
<title>Test</title>
<style type="text/css">
img { vertical-align: middle; }
span { text-decoration: underline; font-variant: small-caps; }
</style>
</head>
<body>
<img src="pic.png">
<span>Abc QWerty AbCdEfGhIjKlMnOpQrStUvWxYz1234567890</span>
</body>
</html>
Thanks for any suggestions.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
我也没有设法让它工作(
zoom:1
对我没有任何作用)。 我现在求助于使用border-bottom
而不是underline
...I also haven't managed to get this to work (
zoom:1
does nothing for me). I now resorted to usingborder-bottom
instead ofunderline
...如果您不关心 CSS 验证,请添加
zoom:1
声明(或任何其他hasLayout
调用声明)到您的 span 样式将解决问题(至少在 IE6/7 中)。If you don't care about CSS validation adding a
zoom:1
declaration (or any otherhasLayout
invoking declaration) to your span style will solve the problem (in IE6/7 at least).