Forum Moderators: open

Message Too Old, No Replies

validator

I don't understand what's going on

         

mcibor

10:03 am on Jan 3, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



my page is such:

<!doctype html public "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title>Hello World</title>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-2" />
<meta name="keywords" content="hello, world" />
</head>
<body>
<p>Hello World = Witaj Świecie</p>
</body>
</html>

And while validating I get 3 error messages:
Line 6, column 47: document type does not allow element "META" here
<meta name="keywords" content="hello, world" />

Line 7, column 6: end tag for element "HEAD" which is not open
</head>

Line 8, column 5: document type does not allow element "BODY" here
<body>

I simply don't understand what to do to validate it.
I must have encoding iso-8859-2

Please help!
Thnx

Best regards
Michal Cibor

Romeo

10:18 am on Jan 3, 2005 (gmt 0)

10+ Year Member



Hi Michal,

what validator are you using? What does it say about the doctype it is checking against (your first error message)?

Try to adapt your doctype statement, as far as I know, it is case sensitive:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">

Also, when I checked last, the validator.w3.org did not like an ending slash in the meta tags of a HTML 4.01 Transitional page.

Regards,
R.

kaled

10:22 am on Jan 3, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Looks to me like you're confusing HTML with XHTML. Delete the / chars on the meta tags and try validating again.

Kaled.

mcibor

2:36 pm on Jan 3, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



I was using validator at validator.w3.org

mcibor

2:39 pm on Jan 3, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Interesting!
the absence of / before > in meta tags seemed to be an answer. But why? No idea!

Thanks for trouble!
Best wishes on the New Year threads!
Michal Cibor

stever

2:48 pm on Jan 3, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



The answer is that those types of closing tags are indicative of XHTML (where you must close every tag). Your doctype was HTML 4.01 Transitional, which allows unclosed meta, image and break tags and therefore sees the correct xhtml as an error.