IE 中列表元素渲染错误?
有人以前见过这种情况吗?对此可以采取什么措施吗? 此链接是 IE 中列表显示的 PNG 屏幕截图 - 如果仔细观察,每个连续项目的每个元素的行高都会变得更大一些。 网站的外观完全由 CSS 控制。
Screen Shot
这不是什么大不了的事,但确实很奇怪。
另外,请注意白线和框边框之间的空间 - 这在 FF 或 Chrome 中也不存在,只有 IE 中存在。
Has anyone seen this before - and can anything be done about it? This link is to a PNG screen shot of a list display in IE - if you look closely, the line height of each element is getting a little bigger for each successive item. The web site look is entirely controlled by CSS.
Screen Shot
It's not a huge deal, but it sure is weird.
Also, note the space between the white line and the box border - that's not there in FF or Chrome, either, only IE.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
看起来像是 IE7 中的一个错误。
我刚刚在 IE8 上进行了测试,在 IE8 模式下按预期工作,但在兼容模式下表现出相同的行为。
更新:搞乱了,似乎是
overflow:hidden
风格导致的。Looks like a bug in IE7.
I just tested on IE8, works as expected in IE8 mode, but exhibits the same behaviour in compatibility mode.
Update: messing about, it seems it the
overflow:hidden
style causing that.我看到您的页面是 XHTML 并且它验证了...
但与大多数 XHTML 页面一样,它被用作
text/html
而不是application/xhtml+xml
(如果是 IE 将无法识别它,并询问您是否要保存文件)。 因此,尽管使用 XHTML 是一个好主意,但每个浏览器都会获得 XHTML 服务并告诉它是 HTML,因此您的有效 XML 会被解析为 html 标签组。 (如果您确实想要兼容性,并且确实不需要将页面解析为 XML,那么“HTML 4.01 Strict”仍然是最佳选择)我仍然不确定这会如何影响列表呈现(因为语法列表中的内容应该本质上是相同的),但如果 IE 不理解标签,它可能无法获得结束标签。 它让我想起如果你忘记了 li 上的结束标记,并且在上面有一点填充,你会得到的效果......
永远不要尝试在 IE 中获得像素完美的渲染,你会发疯,而且你可能不会成功; 学会忍受它。 :P
I see your page is XHTML and it validates...
But like allmost any XHTML page it's served as
text/html
and notapplication/xhtml+xml
(if it were IE would not recognize it, and ask if you wanted to save the file). So allthoug it's a nice idea to use XHTML, every browser gets served XHTML and told it's HTML so your nice valid XML is parsed as html tagsoup. (If you really wand compatibility, and you don't really need to parse your page as XML, then "HTML 4.01 Strict" is still the best choice)Still I'm not sure how that could affect the list rendering (as the syntax in a list should be essentially the same), but if IE don't understand a tag it might not get the endtag. It reminds me of the effect you get if you forget the endtag on a li, and have a just a little padding on it...
Never try to get pixel perfect rendering in IE, you'll go mad and you probably won't succeed; learn to live with it. :P