0

I have some simple code:

<h3>An h3 header</h3>
<ul>
 <li>More stuff</li>
 <li>other stuff</li>
 <li>Still other stuff
   <ul>
      <li>inner stuff1</li>
      <li>inner stuff2</li>
      <li>inner stuff3</li>
    </ul>
  </li>
  <li>Another list item</li>
  <li>some More stuff</li>
  <li>another other stuff</li>
  <li>text other stuff
    <ul>
       <li>other inner stuff1</li>
       <li>other inner stuff2</li>
       <li>other inner stuff3</li>
       <li>other inner stuff4</li>
    </ul>
  </li>
</ul>
<h3>This h3 tag no has no top margin at all in IE7 and IE8, the above h3 tag has margin</h3>

The code renders fine in IE9, FF, and Chrome. Meaning there is margin between the last h3 tag and the final /ul tag. Any thoughts? There is a global css reset file which zeros out everything.

4

1 回答 1

0

您是否通过W3C 验证器运行您的代码?

如果您的 HTML 无效,IE 可能会恢复到怪癖模式,而不管 DOCTYPE 是什么,因此会忽略 ul 上的 css 边距。另外请确保文档中的第一件事是 DOCTYPE(没有空格),否则 IE 将忽略它。

于 2012-06-02T12:15:26.867 回答