PDA

View Full Version : Doc title !!


wap3
10-02-2002, 09:52 AM
Hello,

I have a basic question, something I should already know but well Im not sure so i'll ask. :o

Why do some sites have a doc title in the source code for their pages. Does it help with rankings or serve some other purpose. Is it a good idea to include it and how do they work ??

By a doc title i mean this:

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">

Thanks

:thumbsup:

Mhtml
10-02-2002, 11:26 AM
I have always wondered the same thing. I have alawys thought that it defines what the content of the page is, like it contains html version whatever and the language it is in.

Is this right?

Mhtml
10-02-2002, 11:28 AM
also I have noticed some of them have an address to a .dtd file.

brothercake
10-02-2002, 12:55 PM
Briefly (for this is a big subject) the doctype specifies what type of document it is. The example here is for HTML 4.0 Transitional; there are doctypes for HTML 4.0 Strict, XHTML 1.0 Transitional, etc. and which you use affects the browser's rendering behaviour (sometimes; to some extent).

For eg, in IE6 and Mozilla using a STRICT or XHTML Transitional doctype switches on "standards compliant" mode, where rendering is to a w3c standard. Using a HTML 4.0 Transitional doctype causes "quirks mode" where the browser maintains conformance with the "de-facto standards" that most people use - things like IE5's broken box model.

A "dtd" is a "document type definition"; the dtds for HTML and XHTML are already known to the browser, so you don't need to give a url in the Doctype tag. Writing your own dtds is only something you're likely to need to do if you;re working with XML; I know little else so I'll defer to someone else on this.

Like I said .. this is a big subject. More reading:http://gutfeldt.ch/matthias/articles/doctypeswitch.html

ronaldb66
10-02-2002, 01:02 PM
... furthermore, a valid document must have a doctype so a validator knows to which DTD it has to validate the document. In fact, without a correct doctype the document can never be valid.

MCookie
10-02-2002, 01:35 PM
>> DTD in the source code for their pages. Does it help with rankings..

No, not at all.
About optimizing your site for search engines: http://www.spider-food.com/

Another link about doctypes: http://www.alistapart.com/stories/doctype/