Welcome to WebmasterWorld Guest from 23.22.250.113

Forum Moderators: incrediBILL

Message Too Old, No Replies

Doctype

what is it exactly?

     

jesstp

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

10+ Year Member



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?

ChadSEO

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

10+ Year Member



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

jesstp

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

10+ Year Member



Thanks Chad!

Romeo

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

10+ Year Member



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.

jesstp

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

10+ Year Member



thank you both!

jesstp

10:59 am on Aug 18, 2005 (gmt 0)

10+ Year Member



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?

encyclo

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

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



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.

jesstp

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

10+ Year Member



thanks! Should this go on all pages or only the index page?

encyclo

12:06 pm on Aug 18, 2005 (gmt 0)

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



You should put the doctype on every page. :)
 

Featured Threads

Hot Threads This Week

Hot Threads This Month