correct doctype syntax

Do you have a question? Post it now! No Registration Necessary.  Now with pictures!

Threaded View
For some reason, the W3C validator is not recognizing my doctype all the
I've tried this statement which is cut-n-pasted from their site.
Sometimes it's recognized, sometimes not and I have to manually select it to

            " ">

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"> <--- Is this enough to be

            " "> <-- Is this URL
required to be functionally correct?

I want 4.01 Strict and neither of the above statements seem to be recognized
100% of the time by the validator. Is there a better or different validator
that I can use?

Re: correct doctype syntax

Quoted text here. Click to load it

The URL is not required in this case.

There are two reasons to include the URI
1. Including the URI changes browsers from quirks to standards mode.
This is the case with the 4.01 Transitional doctype where adding teh
URI triggers standards mode. But not the case for 4.01 Strict where
all variants of doctype trigger standards mode in all doctype sniffing
2. The document is going to be given to a user agent that (a) actually
looks up the DTD based on the doctype and (b) doesn't already know
about the HTML 4.01 DTD. The chance that your page would be given to
such a tool are miniscule. Browsers don't look up DTDs and validators
know about HTML 4.01.

Quoted text here. Click to load it

Can you post the URI of a page where the validator doesn't recognise
the doctype?


"My theories appal you, my heresies outrage you,
 I never answer letters and you don't like my tie."  - The Doctor

Site Timeline