Forum Moderators: open

Message Too Old, No Replies

Doctype misdeclaration

when is 4.01 actually 3.2?

         

Dave McClure

7:43 am on Oct 4, 2004 (gmt 0)

10+ Year Member



Is it wrong to declare a doctype 4.01 when the document (according to "html tidy") appears to be 3.2? I would have thought a lot of simple pages could be described as either, so what point is "tidy" making?

BlobFisk

8:44 am on Oct 4, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Other than the fact that it makes for bad practice, many tags used in HTML3.2 were deprecated in HTML4.01. Therefore, if you specify a 4.01 doctype and use tags deprecated in this version, but perfectly legal in HTML3.2, then your markup is invalid.

HTH

Dave McClure

9:50 am on Oct 4, 2004 (gmt 0)

10+ Year Member



Thanks HTH. I think I probably asked the wrong question! I should have said - is there any point in revising previously validated 3.2 pages as validated 4.01 pages, i.e. updating the doctype declaration, if the pages are able to validate correctly as 4.01? By "any point" I mean does it help in any way, e.g. browser compatability or search engine discovery.

encyclo

11:00 am on Oct 4, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



If the pages validate as HTML 3.2, it doesn't neccessarily mean that they will validate as HTML 4.01, because certain elements were dropped from the later version.

So, there's no advantage in switching the doctype (SE bots don't check doctypes), but there could be the disadvantage that you are "invalidating" your pages. If it is 3.2, stick with a 3.2 doctype.

You could argue that, because 3.2 is an older and simpler standard, the bots will find it easier to parse than 4.01.

Lance

11:42 am on Oct 4, 2004 (gmt 0)

10+ Year Member



I think what the poster is saying is that his page "Tentatively Validates" as HTML 4.01 already. And if that's the case, should he go ahead and change the!DOCTYPE to match.

Unfortunately though, I don't know the answer.

Dave McClure

12:19 pm on Oct 4, 2004 (gmt 0)

10+ Year Member



Hi Lance - yes, that's exactly it. When revising some 3.2 pages I thought that they looked 4.01 valid, so tested them at W3C with a 4.01 doctype declaration, which they passed. So now I'm wondering if there is any advantage (or disadvantage) of changing the doctype from 3.2 to 4.01

encyclo

12:37 pm on Oct 4, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



OK, now I understand! The answer is no - the declared doctype doesn't make any difference to search engines at all. The presence of a full 4.01 doctype (with the w3c url) will however change the rendering mode for newer browsers, so it might affect the way the page looks.

If you are going to leave the pages as-is, best to leave it with 3.2 - otherwise, be careful if you switch to 4.01 to make sure the page isn't affected when the browser switches to standards-compliance mode.

Dave McClure

3:49 pm on Oct 4, 2004 (gmt 0)

10+ Year Member



Many thanks - that all makes sense.

Lance

4:33 pm on Oct 4, 2004 (gmt 0)

10+ Year Member



Oh, and Dave...

"HTH" means "Hope This Helps"

:)