Question:
What is the correct !DOCTYPE?
anonymous
2012-12-20 22:14:51 UTC
Hi,

In programming classes we always just used but thats because they never went live on the internet. People that sell websites commercially, what is the correct DOCTYPE for an XHTML & CSS website? I know it has some kind of link to w3?
Five answers:
anonymous
2012-12-20 22:20:44 UTC
XHTML is NOT deprecated. Neither is HTML 4.01. HTML 5 has not been released yet and is not supported in all browsers. The same for CSS 3.



See all document types recommended:



http://www.w3.org/QA/2002/04/valid-dtd-list.html



CSS really doesn't need a doctype, but you do have to link to any external CSS file on each page:



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



Ron
newguy_feroz
2012-12-21 00:04:36 UTC
Typical HTML DOCTYPE statement:









Annotated syntax:







Explanation

General : A pair of forward slash characters ("//") is used as delimiters between keyword fields in the FPI declaration.

(1) : [Top Element] - Indicates the top level element type declared in the DTD; for HTML it is .

(2) : [Availability] - field indicates whether the identifier is a publicly accessible object (PUBLIC) or a system resource (SYSTEM) such as a local file or URL. HTML/XHTML DTDs are specified by PUBLIC identifiers.

(3) : [Registration] - Indicated by either a plus ("+") or minus ("-"). A plus symbol indicates that the organization name that follows is ISO-registered. A minus sign indicates the organization name is not registered. The IETF and W3C are not registered ISO organizations and thus use a "-".

(4) : [Organization] - This is the "OwnerID" - a unique label indicating the name of the entity or organization responsible for the creation and/or maintenance of the artifact (DTD, etc.) being referenced by the DOCTYPE. The IETF and W3C are the two originating organizations of the official HTML/XHTML DTDs.

(5) : [Type] - This is the "Public Text Class" - the type of object being referenced. There are many different keywords possible here, but in the case of an HTML/XHTML DTD, it is "DTD" - a Document Type Definition.

(6) : [Label] - This is the "Public Text Description" - a unique descriptive name for the public text (DTD) being referenced. If the public text changes for any reason, a new Public Text Description string should be created for it.

(7) : [Language] - This is the "Public Text Language"; the natural language encoding system used in the creation of the referenced object. It is written as an ISO 639 language code (uppercase, two letters.) HTML/XHTML DTDs are usually (always?) written in English ("EN".)

(8) : [URL] - This is the optional explicit URL to the DTD being referenced.
WK of Angmar
2012-12-21 12:09:08 UTC
is the doctype that is going to be the new standard for HTML5. HTML5 is still is in its draft stages, so it has NOT been fully released. However, most of the modern web browsers have begun to support the newer HTML5 elements (including the HTML5 doctype), so it will work in modern web browsers.



The version of HTML that is currently released is HTML4.01. The doctype for this version is as follows:




"http://www.w3.org/TR/html4/strict.dtd">



Note that you can put it in a single line if you want to. and the "strict" can be changed depending on how strictly you want the web browser to parse the HTML.



XHTML is slightly different. The latest version of XHTML is XHTML2.0 and the doctype for that is:


"http://www.w3.org/MarkUp/DTD/xhtml2.dtd">



To be honest, just stick with the DOCTYPE you have now. Although it's not strictly declaring that its XHTML, it is supported by most current web browsers and it is going to be the future DOCTYPE for HTML5.
Ben
2012-12-20 22:18:34 UTC
is the doctype used for HTML5 websites. Any website developed today should be using that doctype.



An XHTML document should have a doctype of
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">



But, as I said, XHTML is considered deprecated- just stick with plain HTML, and the HTML5 doctype works properly on all browsers.
anonymous
2012-12-20 22:22:02 UTC
it is and always has been to for the and leave your opps, I mean out of the problem.. since the use will you for it's


This content was originally posted on Y! Answers, a Q&A website that shut down in 2021.
Loading...