Help - Search - Members - Calendar
Full Version: Not valid XHTML 1.1
Invision Power Services > Community Forums > Community Web Design and Coding
Sebastian Mares
Can anyone tell my why this isn't valid XHTML 1.1:

HTML
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">

<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>MaresWEB :: Home</title>
</head>

<body>
MaresWEB
</body>

</html>


I get the following error:

QUOTE
Line 10, column 4: character data is not allowed here

MaresWEB

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

Line 11, column 8: end tag for "body" which is not finished

</body>

Most likely, You nested tags and closed them in the wrong order. For example <p><em>...</p> is not acceptable, as <em> must be closed before <p>. Acceptable nesting is: <p><em>...</em></p>

Another possibility is that you used an element (e.g. 'ul') which requires a child element (e.g. 'li') that you did not include. Hence the parent element is "not finished", not complete.


blink.gif
Michael_C
The text needs to be inside a block-level element and the content type is wrong.
HTML
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">

<head>
<meta http-equiv="Content-Type" content="application/xhtml+xml; charset=iso-8859-1" />
<title>MaresWEB :: Home</title>
</head>

<body>
<div>
MaresWEB
</div>
</body>

</html>
Sebastian Mares
Thanks! wink.gif
Bear
I think the error message was pretty clear and straight forward. Hmmm.
Sebastian Mares
QUOTE(Bear @ Apr 3 2005, 02:54 PM)
I think the error message was pretty clear and straight forward. Hmmm.
*


Yes, but I didn't know that I have to place a DIV inside the body. :">
Bear
You don't need a DIV element. It could be any of the container elements - DIV, P, SPAN, etc.
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2009 Invision Power Services, Inc.