0

Possible Duplicate:
What are the different doctypes in html and what do they mean?
HTML DTDs - what's the point?

there are different types of DTD like strict, transitional and etc., which DTD is mostly used in common and why?

Community
  • 1
  • 1
karthick
  • 11,998
  • 6
  • 56
  • 88
  • Why do you want to know? – Sergio Tulentsev Dec 27 '11 at 11:30
  • @SergeiTulentsev: I see there are lot of DTD's i just want to know the difference. I can understand that there are schemas but i just want to know which one is used mostly? – karthick Dec 27 '11 at 11:32
  • 1
    According to the W3C specs, different DTDs include different features. For example, if you want to use in your webpage, you'll use the Transitional doctype. If you want to use , you'll use XHTML 1.1, etc. In practice though, it doesn't matter, because all browsers support features no matter what Doctype declaration you have. As long as you use one; don't leave it out altogether! – Mr Lister Dec 27 '11 at 12:11

3 Answers3

0

The most recent html5-compatible doctype you can use is simply:

<!doctype html>

This should be compatible with all modern browsers.

For HTML4 document, it doesn't really matter. I used to choose Transitional.

  • 1
    How do you figure "it doesn't really matter" for HTML 4? The DTDs imply different things; you should use the one that is most appropriate for your page. – Cody Gray - on strike Dec 27 '11 at 13:39
0

What is a DOCTYPE:

A Document Type Declaration, or DOCTYPE, is an instruction that associates a particular SGML or XML document (for example, a webpage) with a Document Type Definition (DTD) (for example, the formal definition of a particular version of HTML).

Why we need a DOC type:

If you do not declare a specific doctype correctly a visitors browser must "guess" (usually by applying the loosest possible doctype or a "quirks" mode doctype of its own) resulting in slower rendering.

Comparison of document types

Transitional vs. Strict Doctypes

defau1t
  • 10,593
  • 2
  • 35
  • 47
-1

We mostly use this DTD only...

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

Check the following link if you have any doubts

http://www.w3schools.com/tags/tag_doctype.asp

vyshak
  • 41
  • 4
  • That's a terrible doctype to use. It (a) doesn't give standards mode in browsers; (b) When served as `text/html` (as it almost invariably is), causes browsers to see the mark-up in a completely different way to validators, making it harder than necessary to know if your validated mark-up will actually work in a browser; and (c) was created over 10 years ago to aid *transition* towards the proper standard. You really shouldn't need to be still transitioning now. – Alohci Dec 27 '11 at 13:05
  • 1
    And by the way, around here it's unwise to refer to W3Schools as any sort of authority, and *especially* to do with XHTML as they don't know what they are talking about. – Alohci Dec 27 '11 at 13:12
  • It's not just XHTML where they don't know what they're talking about... http://w3fools.com/ – Cody Gray - on strike Dec 27 '11 at 13:39