W3c

Status
Nicht offen für weitere Antworten.

Kalma

Erfahrenes Mitglied
Hallo,

der W3C validator sagt folgende Meldungen:
Code:
   1.   Error  Line 6, Column 66: character data is not allowed here.

      … <meta http-equiv="content-language" content="de" />

      ?

      You have used character data somewhere it is not permitted to appear. Mistakes that can cause this error include:
          * putting text directly in the body of the document without wrapping it in a container element (such as a <p>aragraph</p>), or
          * forgetting to quote an attribute value (where characters such as "%" and "/" are common, but cannot appear without surrounding quotes), or
          * using XHTML-style self-closing tags (such as <meta ... />) in HTML 4.01 or earlier. To fix, remove the extra slash ('/') character. For more information about the reasons for this, see Empty elements in SGML, HTML, XML, and XHTML.
   2. Error Line 11, Column 7: end tag for element "HEAD" which is not open.

      	</head>

      ?

      The Validator found an end tag for the above element, but that element is not currently open. This is often caused by a leftover end tag from an element that was removed during editing, or by an implicitly closed element (if you have an error related to an element being used where it is not allowed, this is almost certainly the case). In the latter case this error will disappear as soon as you fix the original problem.

      If this error occurred in a script section of your document, you should probably read this FAQ entry.
   3. Error Line 12, Column 5: document type does not allow element "BODY" here.

      <body>

      ?

      The element named above was found in a context where it is not allowed. This could mean that you have incorrectly nested elements -- such as a "style" element in the "body" section instead of inside "head" -- or two elements that overlap (which is not allowed).

      One common cause for this error is the use of XHTML syntax in HTML documents. Due to HTML's rules of implicitly closed elements, this error can create cascading effects. For instance, using XHTML's "self-closing" tags for "meta" and "link" in the "head" section of a HTML document may cause the parser to infer the end of the "head" section and the beginning of the "body" section (where "link" and "meta" are not allowed; hence the reported error).

Das dumme ist, wie soll ich <meta ... /> und </head> valide machen? :confused:
 
...oder du hast die Datei irgendwo inkludiert, wo der <head>-Tag bereits enthalten ist=) Dann wäre es mir auch ein Rätsel :P ..
 
Ne eben nicht.
Mein Quelltext:

HTML:
<?xml version="1.0" ?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
       "http://www.w3.org/TR/html4/loose.dtd">
<html>
	<head>
                <meta http-equiv="content-language" content="de" />
                <meta http-equiv="Content-Type" content="text/html;
                charset=ISO-8859-1" />
		<title>Liebfrauenrealschule Nottuln</title>
		<link href="style.css" type="text/css" rel="stylesheet" />
	</head>
<body>

		<div id="wrapper">
			<div id="header_kopf">
                                <div id="header_kopf_links">
				        Impressum | Administration
                                </div>
                                <div id="header_kopf_w3c">
 <a href="http://jigsaw.w3.org/css-validator/">
  <img style="border:0;height:22px"
       src="http://jigsaw.w3.org/css-validator/images/vcss" 
       alt="Valid CSS!" />
 </a>

                                </div>
			</div>
			<div id="header">&nbsp;</div>
			<div id="navigation">
				<a href="#">home</a>
				<a href="#">aktuell</a>
				<a href="#">termine</a>

				<a href="#">programm</a>
				<a href="#">information</a>
				<a href="#">geschichte</a>
				<a href="#">förderverein</a>
			</div>
			<div id="content">&nbsp;</div>
			<div id="footer">&nbsp;</div>

		</div>
</body>
</html>
 
Hi!

using XHTML-style self-closing tags (such as <meta ... />) in HTML 4.01 or earlier. To fix, remove the extra slash ('/') character. For more information about the reasons for this, see Empty elements in SGML, HTML, XML, and XHTML.

Frag mich nicht, wieso das so ist, aber entferne die Slashes im Meta- und Link-Tag und es ist valide ;)

Liebe Grüße,
Mark.
 
Du verwendest ganz einfach die falsche Dokumenttypdeklaration (eine für HTML statt XHTML) und hast die Angabe des Namenraums vergessen:
HTML:
<?xml version="1.0" encoding="ISO-8859-1" ?>
<!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">
…
Aber wieso verwendest du nicht einfach HTML 4.01 Transitional?
 
Du musst dich für eine (X)HTML-Version entscheiden und darfst sie nicht vermischen. In deinem Fall ist es nun ein als XHTML 1.0 Transitional ausgezeichnetes Dokument mit vermischter HTML- und XHTML-Syntax.
 
gefixt:

HTML:
<?xml version="1.0" ?>
<!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>
		<meta http-equiv="content-language" content="de" />
		<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" />
		<title>Liebfrauenrealschule Nottuln</title>
		<link href="style.css" type="text/css" rel="stylesheet" />
	</head>
<body>
	<div id="wrapper">
		<div id="header_kopf">
			<div id="header_kopf_links">
				<a href="#">Impressum</a> |
				<a href="#">Administration</a>
			</div>
			<div id="header_kopf_w3c">
				<a href="http://jigsaw.w3.org/css-validator/">
					<img style="border:0;height:22px" src="http://jigsaw.w3.org/css-validator/images/vcss" alt="Valid CSS!" /></a>
			</div>
		</div>
		<div id="header">
			&nbsp;
		</div>
		<div id="navigation">
			<a href="#">home</a>
			<a href="#">aktuell</a>
			<a href="#">termine</a>
			<a href="#">programm</a>
			<a href="#">information</a>
			<a href="#">geschichte</a>
			<a href="#">f�rderverein</a>
		</div>
		<div id="content">
			&nbsp;
		</div>
		<div id="footer">
			&nbsp;
		</div>
	</div>
</body>
</html>


//Edit.
Kam etwas zu spät, aber Gumbo hat natürlich Recht. Ich hab einfach nur den / bei der Metanangabe wieder hinzugefügt. :)

Matthias
 
Status
Nicht offen für weitere Antworten.
Zurück