你能告诉我为什么我的网页在IE中显示不同以及如何解决它

时间:2021-11-02 03:29:51

I've been browsing through all of the CSS related cross-browser questions trying to troubleshoot my IE styling issues with no luck. Can anyone tell me how to fix my homepage styles so that it displays the same in IE as it currently does in Firefox? I've used Firebug (probably why it looks good in Firefox) but I can't find any tools for IE that will let me change the stylesheet real time. I'm just as interested in the process of figuring out this answer as I am in the answer itself so posting the steps you took to figure it out would be beneficial. (want to be able to do this myself next time!!!)

我一直在浏览所有与CSS相关的跨浏览器问题,试图解决我的IE样式问题而没有运气。任何人都可以告诉我如何修复我的主页样式,以便它在IE中显示与目前在Firefox中相同的样式吗?我使用过Firebug(可能是为什么它在Firefox中看起来不错)但是我找不到任何IE工具可以让我实时更改样式表。我对解决这个问题的过程感兴趣,因为我在答案本身,所以发布你用来弄清楚它的步骤将是有益的。 (希望下次能够自己做!!!)

Website is AppQandA.com. Scroll down to the bottom in IE and notice the footer. It's not like this on every page.....just the main page and the questions page.

网站是AppQandA.com。在IE中向下滚动到底部并注意页脚。在每个页面上都不是这样.....只是主页面和问题页面。

2 个解决方案

#1


0  

The problem in IE is with the "border-left: 10px solid #333333;" rule. If I remove this, it works in IE (but obviously breaks in Firefox).

IE中的问题是“border-left:10px solid#333333;”规则。如果我删除它,它可以在IE中工作(但在Firefox中明显中断)。

There is a tool a bit like Firebug for Internet Explorer:

有一个类似Firebug for Internet Explorer的工具:

http://www.stevefenton.co.uk/Content/Blog/Date/200902/Blog/Something-Like-Firebug-For-Internet-Explorer/

http://www.stevefenton.co.uk/Content/Blog/Date/200902/Blog/Something-Like-Firebug-For-Internet-Explorer/

Potential Fixes:

可能的修复:

1) Browser-specific styles (yuck) this would be a quick fix to get it working. Put another stylesheet AFTER your main stylesheet to override a style:

1)浏览器特定的样式(yuck)这将是一个快速解决方案,以使其工作。在主样式表之后放置另一个样式表来覆盖样式:

<!--[if IE]>
    <link rel="stylesheet" type="text/css" href="ie.css" />
<![endif]-->

And inside, override the rule...

在里面,覆盖规则......

#footer { border-left: none; }

EDIT: Potential issue spotted

编辑:发现潜在问题

Your problem may be getting caused by incorrect tag nesting. You can avoid these kind of problems by validating your HTML using

您的问题可能是由不正确的标记嵌套引起的。您可以通过验证HTML来避免这些问题

http://validator.w3.org

http://validator.w3.org

Specifically, there looks to be a missing closing div tag in these amongst a couple of other errors. Fixing these may actually solve your problem without an IE specific hack.

具体来说,在其他几个错误中,看起来缺少关闭div标签。修复这些可能实际上解决了你的问题没有IE特定的黑客攻击。

#2


0  

There is a tool for ie called ie tester that allows you to check how does a site look in all versions of ie. This tool also has a debug bar, does not have as much features as firebug, actually is quite limited but allows you to explore the DOM and styles.

有一个工具,即称为测试人员,允许您检查网站在所有版本的ie中的外观。这个工具还有一个调试栏,没有像firebug那么多的功能,实际上是非常有限但允许你探索DOM和样式。

There is also a version of firebug (firebug lite) that u can use on ie, altough you need to create a reference in your webpage to use it, see Firebug Lite

还有一个你可以使用的firebug(firebug lite)版本,即使你需要在你的网页中创建一个引用来使用它,请参阅Firebug Lite

I think the problem with your page if you look with firebug, in the #footer rule you have :

我认为你的页面存在问题,如果你用firebug看,你有#footer规则:

#footer{
  margin:0 auto 15px
}

Try removing the 15 px and see how u go.

尝试删除15像素,看看你怎么样。

#1


0  

The problem in IE is with the "border-left: 10px solid #333333;" rule. If I remove this, it works in IE (but obviously breaks in Firefox).

IE中的问题是“border-left:10px solid#333333;”规则。如果我删除它,它可以在IE中工作(但在Firefox中明显中断)。

There is a tool a bit like Firebug for Internet Explorer:

有一个类似Firebug for Internet Explorer的工具:

http://www.stevefenton.co.uk/Content/Blog/Date/200902/Blog/Something-Like-Firebug-For-Internet-Explorer/

http://www.stevefenton.co.uk/Content/Blog/Date/200902/Blog/Something-Like-Firebug-For-Internet-Explorer/

Potential Fixes:

可能的修复:

1) Browser-specific styles (yuck) this would be a quick fix to get it working. Put another stylesheet AFTER your main stylesheet to override a style:

1)浏览器特定的样式(yuck)这将是一个快速解决方案,以使其工作。在主样式表之后放置另一个样式表来覆盖样式:

<!--[if IE]>
    <link rel="stylesheet" type="text/css" href="ie.css" />
<![endif]-->

And inside, override the rule...

在里面,覆盖规则......

#footer { border-left: none; }

EDIT: Potential issue spotted

编辑:发现潜在问题

Your problem may be getting caused by incorrect tag nesting. You can avoid these kind of problems by validating your HTML using

您的问题可能是由不正确的标记嵌套引起的。您可以通过验证HTML来避免这些问题

http://validator.w3.org

http://validator.w3.org

Specifically, there looks to be a missing closing div tag in these amongst a couple of other errors. Fixing these may actually solve your problem without an IE specific hack.

具体来说,在其他几个错误中,看起来缺少关闭div标签。修复这些可能实际上解决了你的问题没有IE特定的黑客攻击。

#2


0  

There is a tool for ie called ie tester that allows you to check how does a site look in all versions of ie. This tool also has a debug bar, does not have as much features as firebug, actually is quite limited but allows you to explore the DOM and styles.

有一个工具,即称为测试人员,允许您检查网站在所有版本的ie中的外观。这个工具还有一个调试栏,没有像firebug那么多的功能,实际上是非常有限但允许你探索DOM和样式。

There is also a version of firebug (firebug lite) that u can use on ie, altough you need to create a reference in your webpage to use it, see Firebug Lite

还有一个你可以使用的firebug(firebug lite)版本,即使你需要在你的网页中创建一个引用来使用它,请参阅Firebug Lite

I think the problem with your page if you look with firebug, in the #footer rule you have :

我认为你的页面存在问题,如果你用firebug看,你有#footer规则:

#footer{
  margin:0 auto 15px
}

Try removing the 15 px and see how u go.

尝试删除15像素,看看你怎么样。