Question

I am using

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN"
"http://www.w3.org/TR/html4/strict.dtd">

in my web pages.

I remember reading in one of those XHTML vs HTML questions that one of the (small) advantages of using HTML is, a shorter DOCTYPE like

<!DOCTYPE html>

Can I use some shorter version like that and specify HTML 4.01 Strict?

If I simply use the short version, what will it be taken as? - Strict, Transitional?

Was it helpful?

Solution

Nope, if there were a shorter version we would all be using it. :) The short type you are referring to is HTML 5.

OTHER TIPS

Nope. I'm afraid that's the only way to specify using HTML 4.01 Strict.

Don't think there's a shorter way of specifying a HTML 4.0 Strict Doctype, which is a pretty specific document type. The doctype you gave would be valid for HTML 5, which may well be a good choice for a new site anyway.

You can simply leave of the URL, and use just the public identifier, like this:

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN">

This will validate as HTML 4.01 Strict, and trigger standards mode. The short DOCTYPE is also valid for HTML 4.01 Transitional, but will trigger quirks mode in some browsers. Keep in mind, though, that this is strictly forbidden in XHTML.

If you want your HTML to be validated you will at least need to specify an (url to) a DTD...

I think you maybe could leave out the public name, maybe be changing the keyword PUBLIC to SYSTEM. But i'm not quite sure about this...

EDIT: Why is this voted down?? The question was for HTML 4, not for 5...

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top