InternetExplorer zeigt meine HTML-Seite nicht richtig an



  • Ich habe folgende HTML-Seite:

    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
    <html>
    <head>
    <title>log.html</title>
    </head>
    <body>
    <font face="Arial"><b><font color="green">Info: </font></b></font><font face="Arial">A color-test object:</font><br>
    <font face="Arial">
    <table width="100%" align="left">
    <tr>
    <td>
    <ul>
    <li>Alpha: 0</li>
    <li>Red: 255</li>
    <li>Green: 255</li>
    <li>Blue: 255</li>
    </ul>
    </td>
    </tr>
    </table>
    </font>
    <br>
    <font face="Arial"><b><font color="green">Info: </font></b></font><font face="Arial">Window destroyed.</font><br>
    </body>
    </html>
    

    Der IE weigert sich die Zeile unter der Tabelle anzuzeigen, stattdessen setzt er den Text rechts neben die Tabelle, da diese 100% breit ist, ist er so freundlich und fügt Scollbalken ein 🙄

    Wie bekomm ich das hin, ohne dass ich da noch ne Tabelle drumherum bastle?



  • <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
    <html>
      <head>
        <title>log.html</title>
        <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
      </head>
      <body>
        <font face="Arial">
          <b>
            <font color="green">
              Info:
            </font>
          </b>
        </font>
        <font face="Arial">
          A color-test object:
        </font>
        <br>
        <font face="Arial">
          <table width="100%" align="left">
            <tr>
              <td>
                <ul>
                  <li>Alpha: 0</li>
                  <li>Red: 255</li>
                  <li>Green: 255</li>
                  <li>Blue: 255</li>
                </ul>
              </td>
            </tr>
          </table>
        </font>
        <br>
        <font face="Arial">
          <b>
            <font color="green">
              Info:
            </font>
          </b>
        </font>
        <font face="Arial">
          Window destroyed.
        </font>
        <br>
      </body>
    </html>
    

    Wenn du dir den Code anschaust, wird man bekloppt.

    HTML vali sagt das (dank FF direkt mit dabei):
    line 19 column 5 - Warning: missing </font> before <table>

    missing </aaa> before <bbb>
    Cause:
    
    A closing tag </aaa> is missing before the opening of another tag <bbb>. This is probably due to a implicit close of the <aaa> tag due to the opening of the <bbb> tag.
    Sample : missing </font> before <p>
    
    There are 2 types of tags in the body of a HTML file, inline and block tags.
    In the following sample, the <font> tag is an inline tag defined as containing only inline tags. But the <p> tag is a block tag. So,
    - a <p> tag can not be contained in a <font> tag.
    - when seeing a <p> tag the font tag is implicitely closed.
    
    BAD     <font size=2><p>abc</p></font>
    GOOD    <p><font size=2>abc</font></p>
      or    <p style="font-size: 80%">abc</p>
      or    <div style="font-size=80%><p>abc</p></div>
    
    In the following sample, <font> tag should be contained in a <p> tag and not the opposite. Also, a better way to define the graphical look of a HTML page is to use Cascaded Style Sheet and use HTML only for the content.
    References:
    
    None
    

    ---

    line 32 column 5 - Warning: discarding unexpected </font>

    discarding unexpected <...>
    Cause:
    
    A opening or closing tag is found. But this tag is currently not expected.
    Opening tag: the tag  is not at his place.
    Closing tag: the tag is not opened. It can be due to a previous error.
    Solution:
    
    For a closing tag, remove the closing tag or add the missing opening tag before
    
    BAD      <b>abc</b></b>
    GOOD     <b>abc</b>
    
    References:
    
    HTML specification: http://www.w3.org/TR/html4/
    

    -----

    line 19 column 5 - Warning: trimming empty <font>

    trimming empty <...>
    Cause:
    
    A tag is empty or just containing spaces. Space are ignored, due that introduction spaces are trimmed in HTML.  This tag is probably really empty or it can be due to a previous error. Tidy is trying to correct the tags of the page.
    
    This can also be a side effect of a tag being implicitely closed by another one just following.
    Solution:
    
    Remove the tag.
    
    BAD     <font size=2></font>
    BAD     <font size=2> </font>
    BAD     <font size=2>
            </font>
    
    Here is a sample of a <p> tag implicitely closed by a block tag <table>. And then <p> is empty. See the defintion of <p> for more info
    
    BAD     <p><table>...
    
    References:
    
    None
    

    ----

    Dein Code ist nicht konform...



  • Ok, wusste nicht, dass ich ner Tabelle durch umschließende font-Tags keine Einheitsschrift verpassen darf.

    Der Code sieht so aus, weil er von meinem log-system ereugt wird und ich bis jetzt zu faul war, nur font-tags einzufügen wenn sich die Schrift auch wirklich ändert.



  • Hab es jetzt geändert, so dass der font für jedes <li>-Element gesetzt wird, aber die Formatierung vom IE ist immernoch so, obwohl der HTML-Code nun wieder von w3c als valid angesehen wird.



  • Hier so sähe es besser aus:

    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
    <html>
      <head>
        <title>LogFile</title>
        <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
        <style type="text/css">
          <!--
          .info_title
          {
            color: #009900;
            font-family: Arial, Helvetica, sans-serif;
            font-weight: bold;
          }
          -->
        </style>
      </head>
      <body>
        <table border="1" cellpadding="4" cellspacing="0" frame="void" rules="rows">
          <tr>
            <td class="info_title">Info:</td>
            <td>A color-test object:</td>
          </tr>
          <tr>
            <td colspan="2">
              <ul>
                <li>Alpha: 0</li>
                <li>Red: 255</li>
                <li>Green: 255</li>
                <li>Blue: 255</li>
              </ul>
            </td>
          </tr>
          <tr>
            <td class="info_title">Info:</td>
            <td>Window destroyed.</td>
          </tr>
        </table>
      </body>
    </html>
    

    Mann könnte alles via css machen, aber für LogFiles reicht das hier vollkommen. ^^ 😉 🙂


Anmelden zum Antworten