0

我只是想知道 IE 9 是否有办法做类似于 Firefox 的事情,我可以在 Web Developer 菜单下选择“检查”选项,然后查看哪些 css 类应用于我页面上的每个元素。我确实注意到 IE 9 的 F12 功能,我可以选择“查看”->“类和 ID 信息”,但它没有显示 css 详细信息。

我的问题是我的网站在 IE 中看起来与在 FF 中完全不同,我正在尝试调试。任何其他建议将不胜感激。谢谢。

编辑1:

具体问题是,在 FF 中,我有一个左边距和上边距,以便所有内容都居中。但是,在 IE 中,一切都是合理的。我决定开始查看页面的第一个 div,因为即使它看起来也有所不同。
有几个 div 相互嵌套,但我想我可能找到了罪魁祸首。

在 IE 中,其中一个 div 的 css 如下所示:

#regionHeader .wrapper {
  overflow:hidden;
}
.wrapper {
  margin:0 auto;
  max-width:1140px;
  min-width:801px;
  width:auto;
}
.wrapper {
  margin:0 auto;
}
.wrapper {
  margin:0 auto;
}
.wrapper {
  zoom:1;
}
.wrapper:after {
  clear:both;
}
.wrapper:after {
  display:table;
}
.wrapper:before {
  display:table;
}

div {
  -webkit-text-size-adjust:none;
  border-bottom:0;
  border-left:0;
  border-right:0;
  border-top:0;
  margin:0;
  padding-bottom:0;
  padding-left:0;
  padding-right:0;
  padding-top:0;
}

但同样在 FF 中具有以下风格:

#regionHeader .wrapper {
  overflow:hidden;
}

.wrapper {
  margin:0 auto;
  min-width:320px;
}

.wrapper, .clearfix, #content {
}

html, body, div, span, object, iframe, h1, h2, h3, h4, h5, h6, p, blockquote, pre, a, abbr, address, cite, code, del, dfn, em, img, ins, q, small, strong, sub, sup, dl, dt, dd, ol, ul, li, fieldset, figure, form, label, legend, table, caption, tbody, tfoot, thead, tr, th, td {
  border:0 none;
  margin:0;
  padding:0;
}

注意 max-width:1140px; 在 IE vs FF 中只有一个最小宽度。那会导致问题吗?不幸的是,这不是我的代码......

4

3 回答 3

4

按 F12,单击工具箱中的指针按钮,单击要检查的元素。该元素的 css 应该在 dom 窗口的右侧。如果不是,您可以单击右侧窗口上方的“样式”按钮。

在此处输入图像描述

于 2013-01-17T14:55:04.820 回答
1

Firebuglite 与 IE6+ 兼容,可以在这里下载:

https://getfirebug.com/firebuglite

于 2013-01-17T14:07:51.463 回答
0

按 F12 调出 IE9 开发者工具。

或选择工具 - F12 开发者工具

于 2013-01-17T14:06:33.530 回答