Menü - Validator meldet Fehler

GFX-Händchen

Erfahrenes Mitglied
Hi all,

kann mir bitte mal jemand sagen was hier falsch ist?:confused:

HTML:
<div class="menu">

<ul>
<li><a href="index.html">Home</a>

<!--[if lte IE 6]>
<a href="#">Home
<table><tr><td>
<![endif]-->


<li><a class="hide" href="#">ausklappbares Listenmenü</a>

<!--[if lte IE 6]>
<a href="../opacity/index.html">OPACITY
<table><tr><td>
<![endif]-->

	<ul>
	<li><a href="../text.html">Untermenü1</a></li>
	<li><a href="text2.html">Untermenü2</a></li>
	<li><a href="text3.html">Untermenü3</a></li>
	<li><a href="text4.html">Untermenü4</a></li>
	<li><a href="#" class="hide">Ausklappares Menü5 &gt;</a>

    <!--[if lte IE 6]>
    <a class="sub" href="../menu/hover_click.html" title="Hover/click with no active/focus borders">HOVER/CLICK &gt;
    <table><tr><td>
    <![endif]-->

		<ul>
			<li><a href="text5.html">Menüpunkt5.1</a></li>
			<li><a href="text6.html">Menüpnkt5.2</a></li>
			<li><a href="text7.html">Menüpunkt5.3</a></li>
            <li><a href="text8.html">Menüpunkt5.4</a></li>
		</ul>

	<!--[if lte IE 6]>
	</td></tr></table>
    </a>
    <![endif]-->

	</li>
</ul>

<li><a href="kontakt.html">Kontakt</a>

<!--[if lte IE 6]>
<a href="#">Kontakt
<table><tr><td>
<![endif]-->

	

<!--[if lte IE 6]>
</td></tr></table>
</a>
<![endif]-->

</li>

<li><a href="text9.html">Menüpunkt4</a>

<!--[if lte IE 6]>
<a href="#">text menüpunkt4
<table><tr><td>
<![endif]-->

	

<li><a href="text10.html">Menüpunkt5</a>

<!--[if lte IE 6]>
<a href="#">text Menüpunkt5
<table><tr><td>
<![endif]-->

<li><a href="impressum.html">Impressum</a>

<!--[if lte IE 6]>
<a href="#">Impressum
<table><tr><td>
<![endif]-->




<!--[if lte IE 6]>
</td></tr></table>
</a>
<![endif]-->

</li>
</ul>

</div> <!-- Ende Klasse menu -->

Hab mir den Code von Stu Nichols hier "geholt" und etwas umgebaut, aber der Validator meldet 9 Fehler.:(

Code:
Validation Output: 9 Errors

   1. Error Line 43, Column 4: document type does not allow element "li" here; missing one of "ul", "ol", "menu", "dir" start-tag

      <li><a class="hide" href="#">ausklappbares Listenmenü</a>

      ?

      The mentioned element is not allowed to appear in the context in which you've placed it; the other mentioned elements are the only ones that are both allowed there and can contain the element mentioned. This might mean that you need a containing element, or possibly that you've forgotten to close a previous element.

      One possible cause for this message is that you have attempted to put a block-level element (such as "<p>" or "<table>") inside an inline element (such as "<a>", "<span>", or "<font>").
   2. Warning Line 66, Column 47: character "&" is the first character of a delimiter but occurred as data

                  <li><a href="text9.html">Menüpunkt5.4</a></li>

      ?

      This message may appear in several cases:
          * You tried to include the "<" character in your page: you should escape it as "&lt;"
          * You used an unescaped ampersand "&": this may be valid in some contexts, but it is recommended to use "&amp;", which is always safe.
          * Another possibility is that you forgot to close quotes in a previous tag.
   3. Error Line 81, Column 4: document type does not allow element "li" here; missing one of "ul", "ol", "menu", "dir" start-tag

      <li><a href="kontakt.html">Kontakt</a>

      ?

      The mentioned element is not allowed to appear in the context in which you've placed it; the other mentioned elements are the only ones that are both allowed there and can contain the element mentioned. This might mean that you need a containing element, or possibly that you've forgotten to close a previous element.

      One possible cause for this message is that you have attempted to put a block-level element (such as "<p>" or "<table>") inside an inline element (such as "<a>", "<span>", or "<font>").
   4. Error Line 97, Column 4: document type does not allow element "li" here; missing one of "ul", "ol", "menu", "dir" start-tag

      <li><a href="text9.html">Menüpunkt4</a>

      ?

      The mentioned element is not allowed to appear in the context in which you've placed it; the other mentioned elements are the only ones that are both allowed there and can contain the element mentioned. This might mean that you need a containing element, or possibly that you've forgotten to close a previous element.

      One possible cause for this message is that you have attempted to put a block-level element (such as "<p>" or "<table>") inside an inline element (such as "<a>", "<span>", or "<font>").
   5. Error Line 106, Column 4: document type does not allow element "li" here; missing one of "ul", "ol", "menu", "dir" start-tag

      <li><a href="text10.html">Menüpunkt5</a>

      ?

      The mentioned element is not allowed to appear in the context in which you've placed it; the other mentioned elements are the only ones that are both allowed there and can contain the element mentioned. This might mean that you need a containing element, or possibly that you've forgotten to close a previous element.

      One possible cause for this message is that you have attempted to put a block-level element (such as "<p>" or "<table>") inside an inline element (such as "<a>", "<span>", or "<font>").
   6. Error Line 115, Column 4: document type does not allow element "li" here; missing one of "ul", "ol", "menu", "dir" start-tag

      <li><a href="impressum.html">Impressum</a>

      ?

      The mentioned element is not allowed to appear in the context in which you've placed it; the other mentioned elements are the only ones that are both allowed there and can contain the element mentioned. This might mean that you need a containing element, or possibly that you've forgotten to close a previous element.

      One possible cause for this message is that you have attempted to put a block-level element (such as "<p>" or "<table>") inside an inline element (such as "<a>", "<span>", or "<font>").
   7. Error Line 131, Column 5: end tag for "li" omitted, but OMITTAG NO was specified

      </ul>

      ?

      You may have neglected to close an element, or perhaps you meant to "self-close" an element, that is, ending it with "/>" instead of ">".
   8. Info Line 106, Column 1: start tag was here

      <li><a href="text10.html">Menüpunkt5</a>

   9. Error Line 131, Column 5: end tag for "li" omitted, but OMITTAG NO was specified

      </ul>

      ?

      You may have neglected to close an element, or perhaps you meant to "self-close" an element, that is, ending it with "/>" instead of ">".
  10. Info Line 97, Column 1: start tag was here

      <li><a href="text9.html">Menüpunkt4</a>

  11. Error Line 131, Column 5: end tag for "li" omitted, but OMITTAG NO was specified

      </ul>

      ?

      You may have neglected to close an element, or perhaps you meant to "self-close" an element, that is, ending it with "/>" instead of ">".
  12. Info Line 43, Column 1: start tag was here

      <li><a class="hide" href="#">ausklappbares Listenmenü</a>

  13. Error Line 131, Column 5: end tag for "li" omitted, but OMITTAG NO was specified

      </ul>

      ?

      You may have neglected to close an element, or perhaps you meant to "self-close" an element, that is, ending it with "/>" instead of ">".
  14. Info Line 35, Column 1: start tag was here

      <li><a href="index.html">Home</a>

  15. Warning Line 143, Column 94: character "&" is the first character of a delimiter but occurred as data

      …n class="kursiv_fett">mittels (X)HTML & CSS</span> und nenne Ihnen einen Websp…

      ?

      This message may appear in several cases:
          * You tried to include the "<" character in your page: you should escape it as "&lt;"
          * You used an unescaped ampersand "&": this may be valid in some contexts, but it is recommended to use "&amp;", which is always safe.
          * Another possibility is that you forgot to close quotes in a previous tag.
 
Hi,

eigentlich sind die Fehlermeldungen eindeutig, und eine valide Code-Vorlage zum Abgleichen besitzt du doch auch.

Beim Umbau des validen Codes sind dir diverse Fehler im Markup bzgl. der Untermenüs unterlaufen.

Entweder fehlen da an diversen Stellen <ul></ul>-Tags für die Untermenüebenen, oder nach den </a>-Tags der schliessende </li>-Tag, wenn dort kein Untermenü folgen soll, wie beispielsweise im Falle des Menüpunktes "Home".

mfg Maik
 
Danke, ich konnte es jetzt bis auf 1 Fehler beseitigen.
Beim folgendem Fehler:confused: finde ich nichts was falsch ist:
Code:
#  Error  Line 99, Column 4: document type does not allow element "li" here; missing one of "ul", "ol", "menu", "dir" start-tag

<li><a href="kontakt.html">Kontakt</a></li>

?

The mentioned element is not allowed to appear in the context in which you've placed it; the other mentioned elements are the only ones that are both allowed there and can contain the element mentioned. This might mean that you need a containing element, or possibly that you've forgotten to close a previous element.

One possible cause for this message is that you have attempted to put a block-level element (such as "<p>" or "<table>") inside an inline element (such as "<a>", "<span>", or "<font>").
 
Da ich deine anvisierte Menüstruktur nicht kenne, tippe ich mal auf diese Variante:

HTML:
<div class="menu">
    <ul>
        <li><a href="index.html">Home</a></li>
        <li><a class="hide" href="#">ausklappbares Listenmenü</a>
            <!--[if lte IE 6]>
            <a href="http://www.tutorials.de/opacity/index.html">OPACITY
            <table><tr><td>
            <![endif]-->
            <ul>
                <li><a href="http://www.tutorials.de/text.html">Untermenü1</a></li>
                <li><a href="text2.html">Untermenü2</a></li>
                <li><a href="text3.html">Untermenü3</a></li>
                <li><a href="text4.html">Untermenü4</a></li>
                <li><a href="#" class="hide">Ausklappares Menü5 &gt;</a>
                    <!--[if lte IE 6]>
                    <a class="sub" href="http://www.tutorials.de/menu/hover_click.html" title="Hover/click with no active/focus borders">HOVER/CLICK &gt;
                    <table><tr><td>
                    <![endif]-->
                    <ul>
                        <li><a href="text5.html">Menüpunkt5.1</a></li>
                        <li><a href="text6.html">Menüpnkt5.2</a></li>
                        <li><a href="text7.html">Menüpunkt5.3</a></li>
                        <li><a href="text8.html">Menüpunkt5.4</a></li>
                    </ul>
                    <!--[if lte IE 6]>
                    </td></tr></table>
                    </a>
                    <![endif]-->
                </li>
            </ul>
        </li>
        <li><a href="kontakt.html">Kontakt</a></li>
        <li><a href="text9.html">Menüpunkt4</a></li>
        <li><a href="text10.html">Menüpunkt5</a></li>
        <li><a href="impressum.html">Impressum</a></li>
    </ul>
</div> <!-- Ende Klasse menu -->

Mit einer konsequent sauberen Code-Einrückung lassen sich die verschachtelten Menü-Ebenen auch überblicken bzw. nachvollziehen, und fehlende oder überschüssige Tags darin leichter orten, wenn dir schon die aussagekräftigen Fehlermeldungen nichts sagen.

mfg Maik
 
Ja, genau, danke!:)
Jetzt schau ich mal wo der Fehler beim Punkt Kontakt liegt.
Weil wenn ich davor nur ein </li> einfüge, dan bringt er mir wieder einen Fehler, aber dein Code passt (wie immer :-) ) - muss nur schaun wo bei mir jetzt was fehlt.;)
 
Habs schon rausbekommen, war der </li> ganz am Ende, der war quasi doppelt.:-(

Gibts denn keinen Danke-Button mehr?:confused:
 
Zuletzt bearbeitet:
Zurück