ie7/8 中的 html/css 定位问题
我一生都无法弄清楚如何在 IE7/8 中正确对齐。
如果您在 Firefox 4+ 中查看该网站,它工作正常!不确定这是否正确。
在“登录”链接所在的顶部;在 Firefox 中正是我想要的,但在 IE 中它显示得很奇怪。
如果有人能提供帮助,那就太好了。 (该网站尚未完全发挥作用。仍在努力中。谢谢!)
I cannot for the life of me figure out how to get this aligned correctly in IE7/8..
If you look at the site in Firefox 4+ it works fine! Not sure if that is the right thing or not..
At the top where the "Sign In" link is; in firefox is exactly how I want it but in IE it is displayed all weird.
If anyone could help, that'd be great. (the site isn't fully functional yet.. still working on it.. thanks!)
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
首先,在尝试调试 CSS 之前,您必须始终验证页面。
您有 23 个错误 此时,它们是非常重要(但很容易修复)的错误。您有未关闭的 div、段落等。可能只是几个错误导致了级联。
我的建议:修复这些错误。从第一个开始,一直向下,直到它们全部消失。您可能会看到 IE 问题消失。其他浏览器只是更加宽容。
当您确实遇到困难时,可以使用条件注释,但 99% 的情况下您并不真正需要它。通常,IE 错误是由其他浏览器能够以优雅的方式处理的错误引起的。
曾几何时,我曾经设计IN Internet Explorer,发现在FF或Chrome中检查我的作品几乎总是与IE的渲染一致。有时,较新的浏览器对错误过于宽容,因此您无法捕获它们。
First, before any attempt to debug CSS is made, you must always validate your page.
You have 23 Errors at this time, and they are pretty important (but easy to fix) ones. You have unclosed divs, paragraphs, etc. It may be just a couple of errors that are causing a cascade.
My advice: Fix those errors. Start at the first one and work your way down until they all are gone. You are likely to see IE problems disappear. The other browsers are just being more forgiving.
Conditional comments are an option for when you're really stuck, but 99% of the time you don't truly need it. Often IE errors are caused by mistakes that other browsers are nice enough to deal with in a graceful manner.
Once upon a time I used to design IN Internet Explorer, and found that checking my work in FF or Chrome was almost always in line with IE's rendering. Sometimes the newer browsers are too forgiving of errors so you don't catch them.
在你的 html 中,你可以使用专门用于 ie 的特殊 css,这样其他浏览器就会忽略:
In your html you can use special css just for ie so other browsers just ignore:
你可以使用 *+ hack 为 IE 创建另一个样式部分。 IE:
you could just create another styling section for IE using *+ hack. IE: