• Jetzt anmelden. Es dauert nur 2 Minuten und ist kostenlos!

W3C Markup Validation

soulxheart

Mitglied
Hallo zusammen

Ich habe mir eine kleine Design-Vorlage geschrieben und wollte sie eben mit dem W3C Markup Validation Service validieren lassen. Ich bekomme da fünf Errors angezeigt. Jedoch finde ich den Fehler einfach nicht.

Das ist das Gerüst der Seite:
HTML:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<link rel="stylesheet" type="text/css" href="style.css" />
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>02_Design</title>
</head>

<body>
    <div class="header">
        02_Design
    </div>
    <div id="navigation">
        <ul>
            <li class="smalltitle">Punkt 1</li>
            <li><a href="#">> Punkt 1.1</a></li>
            <li><a href="#">> Punkt 1.2</a></li>
            <li><a href="#">> Punkt 1.3</a></li>
            <li><a href="#">> Punkt 1.4</a></li>
            <br />
            <li class="smalltitle">Punkt 2</li>
            <li><a href="#">> Punkt 2.1</a></li>
            <li><a href="#">> Punkt 2.2</a></li>
        </ul>
    </div>
    <div id="content">
        <div>
            Das hier ist Inhalt.
        </div>
    </div>
</body>
</html>

Und das sind die fünf Fehler, die ich angezeigt bekomme:

  1. error.png
    Line 20, Column 18: document type does not allow element "br" here; assuming missing "li" start-tag
    <br />
  2. error.png
    Line 21, Column 32: document type does not allow element "li" here; missing one of "ul", "ol", "menu", "dir" start-tag
    <li class="smalltitle">Punkt 2</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>").
  3. error.png
    Line 22, Column 13: document type does not allow element "li" here; missing one of "ul", "ol", "menu", "dir" start-tag
    <li><a href="#">> Punkt 2.1</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>").
  4. error.png
    Line 23, Column 13: document type does not allow element "li" here; missing one of "ul", "ol", "menu", "dir" start-tag
    <li><a href="#">> Punkt 2.2</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>").
  5. error.png
    Line 24, Column 13: 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 ">".
  6. info.png
    Line 20, Column 13: start tag was here
    <br />

Könnt ihr mir da vielleicht weiterhelfen?



Grüsse
 
Hallo Cheffchen

Aber ich möchte doch zwischen den beiden Elementen einen Abstand haben. Oder soll ich das mit einer Klasse lösen? Also dem letzten li-Element class="last" vergeben und dann im CSS .last{margin-bottom:50px}?



Grüsse
 
HAllo,

ah ich seh gerade das soll ja ein Menü sein.
entweder machst das mit der classe oder baust die ul li weiter.
So brauchst keine klasse und kannst alles per css machen
Code:
        <ul>
            <li>Punkt 1
                <ul>
                <li><a href="#">> Punkt 1.1</a></li>
                <li><a href="#">> Punkt 1.2</a></li>
                <li><a href="#">> Punkt 1.3</a></li>
                <li><a href="#">> Punkt 1.4</a></li>
                </ul>
            </li>
            <li>Punkt 2
           <ul>
                <li><a href="#">> Punkt 2.1</a></li>
                <li><a href="#">> Punkt 2.2</a></li>
           </ul>
            </li>
        </ul>
Cheffchen
 
Zurück
Oben