Matthias: Wieso ist dieses Markup nicht valide?

Beitrag lesen

Hallo,

der Validator mag dieses Code-Schnipselchen nicht, aber ich verstehe nicht warum, hat jemand eine Idee warum?

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <title>ProWerk - </title>
    <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
    <link type="text/css" media="all" href="grafik/css/style_1.css" rel="stylesheet" />
</head>
<body>
        <div id="angebot_1">
             <form class="form_shop" action="index.html" method="post" >
                <input type="hidden" name="action" value="add_cart" />
                <input type="hidden" name="item" value="3" />
                <input class="warenkorb_button" type="submit" title="Ihrem Warenkorb hinzuf&uuml;gen" value="[zum Warenkorb]" />
             </form>
        </div>
</body>
</html>

Ausgabe des Validators:

Below are the results of checking this document for XML well-formedness and validity.

1. Error Line 11 column 67: document type does not allow element "input" here; missing one of "p", "h1", "h2", "h3", "h4", "h5", "h6", "div", "pre", "address", "fieldset", "ins", "del" start-tag.

...input type="hidden" name="action" value="add_cart"></input>

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. Error Line 12 column 58: document type does not allow element "input" here; missing one of "p", "h1", "h2", "h3", "h4", "h5", "h6", "div", "pre", "address", "fieldset", "ins", "del" start-tag.

<input type="hidden" name="item" value="3"></input>

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 Line 13 column 125: document type does not allow element "input" here; missing one of "p", "h1", "h2", "h3", "h4", "h5", "h6", "div", "pre", "address", "fieldset", "ins", "del" start-tag.

...zuf&uuml;gen" value="[zum Warenkorb]"></input>

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>").