简体   繁体   English

IE7 / 8中的html / css定位问题

[英]html/css positioning issue in ie7/8

I cannot for the life of me figure out how to get this aligned correctly in IE7/8.. 我一辈子都无法弄清楚如何在IE7 / 8中正确对齐。

If you look at the site in Firefox 4+ it works fine! 如果您在Firefox 4+中查看该站点,则效果很好! 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. 在Firefox中正是我想要的,但是在IE浏览器中它显示的很奇怪。

If anyone could help, that'd be great. 如果有人可以帮助,那就太好了。 (the site isn't fully functional yet.. still working on it.. thanks!) (该网站尚未完全正常运行..仍在工作..谢谢!)

First, before any attempt to debug CSS is made, you must always validate your page. 首先,在尝试调试CSS之前,必须始终验证页面。

You have 23 Errors at this time, and they are pretty important (but easy to fix) ones. 您目前有23个错误 ,它们非常重要(但很容易解决)。 You have unclosed divs, paragraphs, etc. It may be just a couple of errors that are causing a cascade. 您有未关闭的div,段落等。这可能只是导致级联的几个错误。

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. 您可能会看到IE问题消失。 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. 条件注释您真正陷入困境时的一种选择,但是有99%的时间您并不是真正需要它。 Often IE errors are caused by mistakes that other browsers are nice enough to deal with in a graceful manner. IE错误通常是由其他浏览器足以很好地处理的错误引起的。

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. 曾几何时,我曾经 Internet Explorer中进行设计,发现在FF或Chrome中检查我的工作几乎总是与IE的渲染保持一致。 Sometimes the newer browsers are too forgiving of errors so you don't catch them. 有时,较新的浏览器过于宽容错误,因此您不会发现它们。

In your html you can use special css just for ie so other browsers just ignore: 在您的html中,您可以仅将特殊的CSS用于IE,这样其他浏览器就可以忽略:

<!--[if lt IE 9]>
<style type="text/css">
 your css here

</style>
<![endif]-->

you could just create another styling section for IE using *+ hack. 您可以使用* + hack为IE创建另一个样式部分。 IE: IE浏览器:

*+.signin{
 .....
}

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM