0

私はいくつかの簡単なコードを持っています:

<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>

コードは、IE9、FF、および Chrome で正常にレンダリングされます。最後の h3 タグと最後の /ul タグの間にマージンがあることを意味します。何かご意見は?すべてをゼロにするグローバル css リセット ファイルがあります。

4

1 に答える 1

0

W3Cバリデーターを介してコードを実行しましたか?

無効なHTMLがある場合、IEはDOCTYPEに関係なくクァークズモードに戻る可能性があるため、ulのcssマージンを無視します。また、DOCTYPEがドキュメントの最初のもの(スペースなし)であることを確認してください。そうしないと、IEはそれを無視します。

于 2012-06-02T12:15:26.867 に答える