Help - Search - Members - Calendar
Full Version: A List Of Html/xhtml Doctypes
Zymic Webmaster Forums > Web Design & Development > Client Side Scripting > HTML and CSS
Gawdl3y
Ok, I've composed this list for all you (X)HTML freaks out there that really want to make it all valid. So, here we go.

My good old reference, which I read quite a long time ago, is About.com.

Notice: All doctypes must appear at the VERY beginning of the page, even before the html tag.

HTML Doctypes
Doctype #1: Unnamed Doctype - HTML 3.2
This Doctype indicates that all content of the page is written in HTML 3.2. This is probably the oldest version you should use, with the reliability of being fairly safe to use. Nearly all browsers will support it, because it is quite old and is basic HTML. This can be used for such things as Mobile device websites, or websites for something such as a PSP (PlayStation Portable), or other basic websites. It doesn't support some of the newer features, however.

The Syntax:
CODE
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 3.2//EN">



Doctype #2: Transitional - HTML 4.01
This doctype is very nearly the most used one. It allows you to use older deprecated tags, such as the i, b, u, s, or font tags that are no longer contained within the Strict standards. This indicates that your content is the most up-to-date HTML, but still need a little backwards compatibility. It's good for old pages that you have updated to the more recent HTML.

The Syntax:
CODE
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">



Doctype #3: Strict - HTML 4.01
This Doctype is much harder to implement than any of the other HTML doctypes, but it's the best of the best, and meets the most recent standards. It completely obliterates all those deprecated tags. Make sure your HTML is very carefully constructed and that it matches the standards before using this. Not all browsers know the alternatives to the tags that are missing if you use the deprecated tags, though.

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



Doctype #4: Frameset - HTML 4.01
If you are using frames (NOT IFRAMES!) you absolutely MUST use this doctype if you want your pages to be valid.

The Syntax:
CODE
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Frameset//EN" "http://www.w3.org/TR/html4/frameset.dtd">



Doctype #5: Quirk Mode - HTML 4.01
This isn't really a doctype. This is just what your HTML is reverted to if you don't specify a doctype, you use the HTML Transitional Doctype, or you use a doctype without a URL DTD specified.

The Syntax (More of an Example this time):
CODE
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">





XHTML Doctypes
Notice: If you use XHTML, always remember to add the
CODE
<?xml version="1.0" encoding="UTF-8" ?>

BEFORE the doctype, or it won't be valid. Also note that if you use XHTML, it must be PERFECT for it to work. You must have successfully opened and closed every tag in the correct order, and all tags must be typed in lowercase. If you do not, the entire page just dies in a browser-dependent error. It opens up many more possibilities for programming pages, but lets in a little more room for errors. Use the same consideration for the XHTML doctypes as you did for the HTML doctypes.

Doctype #6: Transitional - XHTML 1.0
Same consideration as the HTML transitional doctype.

The Syntax:
CODE
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">




Doctype #7: Strict - XHTML 1.0
Same consideration as the HTML Strict doctype.

The Syntax:
CODE
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">




Doctype #8: Frameset - XHTML 1.0
Same consideration as the HTML Frameset doctype.

The Syntax:
CODE
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Frameset//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-frameset.dtd">





Advanced Doctypes
Notice: These are the very newest doctypes, and there are many browser that do not understand them. I had to take this information almost directly from About.com... I didn't know much about these ones.


Doctype #9: Unnamed Doctype - XHTML 1.1
XHTML 1.1 takes XHTML 1.0 and modularizes it. It allows you to take your XHTML and define only the tags that you want defined in your page. It's very similar to XHTML 1.0 Strict, but removes some of the presentation features.

The Syntax:
CODE
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">




Doctype #10: Unnamed Doctype - XHTML 2.0
This doctype is not meant to be backwards-compatible with HTML 4.01 or XHTML 1.1/1.0. It currently has limited support from browsers, but if you want to use it...

The Syntax:
CODE
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 2.0//EN" "http://www.w3.org/MarkUp/DTD/xhtml2.dtd">




Doctype #11: Unnamed Doctype - HTML 5.0
This one is taken directly from About:
HTML 5.0 is a conglomeration of Web Applications 1.0 and Web Forms 2.0. It was developed to try to address the needs of content authors and continue moving HTML forward, rather than worrying about whether it is valid XML or not. It is supported by browser manufacturers like Apple, Mozilla, and Opera.

The Syntax (VERY simple this time):
CODE
<!DOCTYPE html>






Alright, I'm kinda glad that's over. I just spent half an hour writing this, so i hope it helps someone, at least.
Also, just for you people that want my recommendation:

I almost always use the XHTML 1.0 Strict Standards.
Jetteh22
Very thorough.
I just recently started using doctypes because sometimes my pages wouldn't show up properly. When I googled it I found a few websites that stated doing doctypes would fix the problem.

And they did.

Thanks smile.gif
MrTouz
Also required when you want to validate your pages.
Andrew
No offence but I'd rather you just link to wikipedia articles, they are a little more informative and the information is always right.

http://en.wikipedia.org/wiki/XHTML for example.
Gawdl3y
They're not always right, mainly because anybody can edit them whenever they wish.
Andrew
Actually yes they are because everything has to have sources. If it doesn't it says so.
Banjo
I think this is good because it's a good summary and there is alot to read on wikipedia.
Jacob
Good effort nether the less.
Do not forget to cite your sources though. VERY IMPORTANT!!!

Jacob.
Gawdl3y
I DID site my sources. tongue.gif
Jacob
Where does it say:
QUOTE
Summary of Wikipedia's XHTML page
? Or wherever else you got the information?

Jacob.
Jetteh22
Why does it matter, Narzy?

Nowhere did he state "I typed this up completely by myself" or "This is mine, copyrighted, ect"...

And.. on the 2nd line:

QUOTE
My good old reference, which I read quite a long time ago, is About.com.
Jacob
I missed that line whilst skimming through it.
You must ALWAYS cite your sources. No matter how minor. And in this case, I did not see any so I suggested he should.

Jacob.
MrTouz
QUOTE
Actually yes they are because everything has to have sources. If it doesn't it says so.


Well many, many content are not really good and many many people on some many many contents do NOT follow up wikipedia.

Does it means because you have sources the information is right ? correct ?
No i mean, i could go and change the Cold War definition if i said i had source ? i do have sources.. i have my history teacher, and my books.. but you really think my info will be valid ?

I talk about this because i had a Market Analysis on 'luxury' with Montblanc, and their page was constantly modified and changed... for some reasons it was not always saying the same thing... Montblanc is an international luxury brand known for their pens, and bags... but hey even the best can be wrong on Wikipedia.

You just have to be careful and double check the info you get.
IamShipon1988
Wow thanks Gawdl3y. Must have taken quite a bit of time. For a person like me, I like to work with one dogtype and work on making that dogtype work since I get the specifics from the employer whether they want it HTML strict or XHTML transitional.
Gawdl3y
Sure thing. smile.gif

And, btw... Not everything on Wikipedia has to have sources. If you create a page, it starts out with no sources. If a page needs more sources, they put a [HELP IMPROVE - NEEDS MORE SOURCES] notice on it, but it still isn't completely required to have sources. You need source just to get a beginner-class article or up.
Andrew
Whatever dude, I trust wikipedia. It has never given me wrong information so far. And how do you know that about.com has their information correct? If you wanted to make this thread you SHOULD have gotten all your information from w3c itself.
Banjo
He made this thread to help out people so just leave it at that and stop having a go at him. Just because wikipedia is right doesn't mean he has to use it to get his information from.
Bogey
QUOTE(IamShipon1988 @ Jun 30 2008, 05:26 PM) *
Wow thanks Gawdl3y. Must have taken quite a bit of time. For a person like me, I like to work with one dogtype and work on making that dogtype work since I get the specifics from the employer whether they want it HTML strict or XHTML transitional.

What kind of dogtypes do you use? laugh.gif
Andrew
QUOTE(Bogey @ Jul 2 2008, 10:29 PM) *
What kind of dogtypes do you use? laugh.gif

I personally like to use "Great Dane Strict"
Jacob
Haha Trippin7464. Nice one.

Jacob.
MrTouz
Like said above, Wiki is not the best way to get your info, bu yea.. its has it all.. but is there any other sites with such info ? Yes professional sites such as w3c, but they are only good at their topics.

I think Wiki is great and so far they are doing good.... but again, i would check twice before getting the info.
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2012 Invision Power Services, Inc.