Forum Moderators: open
One question, i get this message for my main page:
Failed validation, 72 errors
Most of the errors is the same, is best to fix? is something that i can get problems from search engine index?
Line 11 column 5: document type does not allow element "HEAD" here.
<head>
Line 33 column 81: character data is not allowed here.
...xml" title="ROR" href="sitemap.xml" />
Line 35 column 18: there is no attribute "MARGINWIDTH".
<body marginwidth="0" marginheight="0" topmargin="0" bottommargin="0" leftmargin
Thanks for your attention
Line 33 column 81: character data is not allowed here.
...xml" title="ROR" href="sitemap.xml" />
It looks like you are using an HTML4.01 Strict DOCTYPE, but you are using the XHTML closing endtag "/>". If most of the errors are the same, then it should be fairly quick to fix?
I don't think MARGINWIDTH etc. have ever been part of any standard - these are browser specific attributes (IE I think initially).
As icantthinkofone says, best to fix them. Even if your page seems to work now, it may not with newer versions of browsers that support the standards better.
Also, for DOCTYPE, try to use HTML 4.01 Transitional since it will probably be the most flexible in your case.
Example:
Use
<body style="margin-top:0; margin-left:0;">
instead of
<body topmargin="0" leftmargin="0">
[<your doctype definition here>]
<html>
<head>
<title></title>
</head>
<body>
</body>
</html>
If you wrote it from scratch you would spot this error right off.
You probably pasted something where you shouldn't have, or have two head tags. I've seen many pages with two opening and closing html tags, and see it on ebay all the time - people paste an entire HTML document in the "content" area of ebay auctions.
Secondly the body attributes you mentioned are as penders says, an old trick to get NN4 and less and IE 4 and less to act similarly. I can't remember which is which, but marginwidth and marginheight work on one of the browsers, topmargin, bottommargin, leftmargin and rightmargin work on the other - this is called proprietaty code, code that is only supported by one browser amd will never validate.
Your best bet is to open your document in Macromedia Homesite (or other high-powered text editor) and run the internal validators on it, review a couple tutorials on HTML and CSS to see where your structure is going wrong, and move all deprecated tags into style sheets - you're probably using the font tag too? IMO proper structure and deprecated tags will rid a document of 95% of validator errors.
Look for missing quotes, unclosed tags and illegal characters (such a " which shoud be represented as " in the visible text).
The doctype must correctly identify the markup as either HTML or XHTML. (If HTML, syntax such as <br /> should not be used.)
The character set should be correctly identified, that probably means a line in the <head> that reads something like...
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
Also <img> should always have an alt attribute even if it's only alt="".
That's just a few ideas that might account for some of the errors.
Kaled.