Welcome to WebmasterWorld Guest from 54.146.221.231

Forum Moderators: incrediBILL

Message Too Old, No Replies

Doctype

what is it exactly?

     
3:39 pm on Aug 16, 2005 (gmt 0)

Junior Member

10+ Year Member

joined:Aug 11, 2005
posts:44
votes: 0


I have built a website and don't have a doctype.

From what I understand it is saying that you conform to the guidelines for HTML.

But what do you type in and is it necessary?

3:51 pm on Aug 16, 2005 (gmt 0)

Preferred Member

10+ Year Member

joined:Apr 12, 2005
posts:371
votes: 0


jesstp,

In most cases, a doctype is not required, but it is highly recommended. If you want your pages to adhere to a particular standard, like XHTML 1.0, then it is required. Adding a doctype is helpful for browsers and robots to know what to expect.

There is a list of valid DocTypes, or DTDs, on the W3's website: [w3.org ] You can also find tools to validate your HTML on their website.

Chad

3:53 pm on Aug 16, 2005 (gmt 0)

Junior Member

10+ Year Member

joined:Aug 11, 2005
posts:44
votes: 0


Thanks Chad!
3:54 pm on Aug 16, 2005 (gmt 0)

Preferred Member

10+ Year Member

joined:Sept 28, 2002
posts:505
votes: 0


Hi Jesstp,
it is good practice to have a DOCTYPE and valid code adhering to the choosen doctype.

While most browsers try to render any HTML even without a doctype, the results are, ahem, somewhat unpredictable.

If you are using mainly 'standard' html, you may choose a HTML 4.01 doctype.

You may look into these links for further reading:

Recommended DTDs to use in your Web document
[w3.org...]

Choosing a DOCTYPE
[htmlhelp.com...]

Regards,
R.

4:14 pm on Aug 16, 2005 (gmt 0)

Junior Member

10+ Year Member

joined:Aug 11, 2005
posts:44
votes: 0


thank you both!
10:59 am on Aug 18, 2005 (gmt 0)

Junior Member

10+ Year Member

joined:Aug 11, 2005
posts:44
votes: 0


ok this might seem like a silly question but I put in the doctype above the <html> tag and it totally messed up my formatting - I tried putting both 4.01 strict and transitional.

Though to be honest Im not sure what form of HTML im using. Im using stlye sheets and have closed all tags.

Any suggestions?

11:15 am on Aug 18, 2005 (gmt 0)

Senior Member from CA 

WebmasterWorld Senior Member encyclo is a WebmasterWorld Top Contributor of All Time 10+ Year Member

joined:Aug 31, 2003
posts:9063
votes: 2


Sounds like a Quirks Mode vs. Standards Mode [webmasterworld.com] problem - pages with a full doctype switch the browser into what is called "standards-compliant mode" which alters the way pages are handled.

Whilst you get your basic validation sorted out, try using this "half" doctype:

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

Once you're validated, then you can switch to a "full" doctype and sort out the display problems.

11:57 am on Aug 18, 2005 (gmt 0)

Junior Member

10+ Year Member

joined:Aug 11, 2005
posts:44
votes: 0


thanks! Should this go on all pages or only the index page?
12:06 pm on Aug 18, 2005 (gmt 0)

Senior Member from CA 

WebmasterWorld Senior Member encyclo is a WebmasterWorld Top Contributor of All Time 10+ Year Member

joined:Aug 31, 2003
posts:9063
votes: 2


You should put the doctype on every page. :)