Forum Moderators: open

Message Too Old, No Replies

Failed validation w3.org

         

bbbandit

2:32 pm on Sep 22, 2006 (gmt 0)

10+ Year Member



Hi

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

icantthinkofone

3:36 pm on Sep 22, 2006 (gmt 0)

10+ Year Member



If a search engine can't figure out your code due to the errors, if may give up and move on.

There is no need to have 72 errors on a page. Fix them. Different browsers may react differently to the same error giving different displays. Always write valid code.

penders

4:49 pm on Sep 22, 2006 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



What DOCTYPE are you using?

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.

webjive81

6:13 pm on Sep 22, 2006 (gmt 0)

10+ Year Member



In all honesty, you probably will not be able to fix all of the validation errors (especially if you are using any server-side language), but you should at least try to scale them down as much as possible. There are simple tricks to doing this - pay attention and use style/css attibutes and work-arounds.

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

rocknbil

6:14 pm on Sep 22, 2006 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



bbandit did you actually write this code or snarf it from someone's web page and hack it up for your purpose? I'm not saying this is necessarily bad, it's how you learn, but I'm betting on #2 because the head of a document is a fundamental part of html structure, it goes

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

bbbandit

5:03 pm on Sep 28, 2006 (gmt 0)

10+ Year Member



My site is a ecommerce php site, i dont know any thing about html, i only did a fresh install and a few modifications of the template.

What is the simple way to find and correct the errors, go to Macromedia Homesite or get a text editor?

Thanks for all the tips, im going to try to do what you say.

kaled

8:21 pm on Sep 28, 2006 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Without any knowledge of HTML correcting the errors is going to be tricky!

Look for missing quotes, unclosed tags and illegal characters (such a " which shoud be represented as &quot; 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.