homepage Welcome to WebmasterWorld Guest from 54.161.166.171
register, free tools, login, search, pro membership, help, library, announcements, recent posts, open posts,
Pubcon Platinum Sponsor 2014
Visit PubCon.com
Home / Forums Index / Code, Content, and Presentation / HTML
Forum Library, Charter, Moderators: incrediBILL

HTML Forum

    
Doctype
what is it exactly?
jesstp




msg:613254
 3:39 pm on Aug 16, 2005 (gmt 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?

 

ChadSEO




msg:613255
 3:51 pm on Aug 16, 2005 (gmt 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

jesstp




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

Thanks Chad!

Romeo




msg:613257
 3:54 pm on Aug 16, 2005 (gmt 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.

jesstp




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

thank you both!

jesstp




msg:613259
 10:59 am on Aug 18, 2005 (gmt 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?

encyclo




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

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




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

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

encyclo




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

You should put the doctype on every page. :)

Global Options:
 top home search open messages active posts  
 

Home / Forums Index / Code, Content, and Presentation / HTML
rss feed

All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
Home ¦ Free Tools ¦ Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About ¦ Library ¦ Newsletter
WebmasterWorld is a Developer Shed Community owned by Jim Boykin.
© Webmaster World 1996-2014 all rights reserved