What is a DOCTYPE and what does it do?

Author: Stefan Vervoort | Please Comment!

When a browser scans your website, the first thing it looks for is its DOCTYPE. It helps render your website the proper way. Ever realized that a browser isn’t a real life guy that can guess in what language and type it is written? Well, a browser is just a tool for people to view your website and if it doesn’t know what and how it has to show a page, there can be some problems in layout. So when there’s a wrong, outdated or no DOCTYPE at all, your HTML, CSS or DOM codes are rendered as they where designed in the late 90’s. That’s not something a web developer like you want, right?

Most new, major browsers render the page the way the DOCTYPE says them to do. With major browsers I mean Internet Explorer 5.0 and up and of course Mozilla’s Firefox 1.0 and up. It is very logical new upcoming browsers will be using DOCTYPES as well. Only Opera doesn’t use DOCTYPEs, they always render a webpage a standard-compliant way.

So, you know why to use a DOCTYPE, but what is a DOCTYPE really. A DOCTYPE describes a document type definition (DTD). This is a machine-readable document that gives the browser the information it needs to display the right way as defined in the DOCTYPE. Example; if the DOCTYPE refers to XHTML 1.0 transitional, it get the information the XHTML 1.0 transitional DTD provides to proper render the webpage.

I hope you understand now what a DOCTYPE is. As a web developer you have to make choices and you might not know how you can use a DOCTYPE and when. In the next topic, I’ll show you the DOCTYPES you can use. You can also visit the W3C’s site for more information.

Different types of DOCTYPES

Of course, there are differences between HTML 4.01, XHTML 1.0 and XHTML 1.1. The DOCTYPE you have to choose depends on the language you have chosen.

HTML 4.01

Strict


Transitional


Frameset


XHTML 1.0

Strict


Transitional


Frameset


XHTML 1.1


Conclusion

Now, do you understand why you need to add a DOCTYPE? If not, please read my article again or leave a comment on this blog. In my opinion, this is a code everyone should use, especially if you think standards are important for the development of the web!

Thanks for reading this article. Please send me an email or leave a comment.

If you want to make your own website design and want to upload doc type file and don’t know how to do this then you can take help from web site hosting service providers. They will not only assist you in making website but will also aid you creating a good business opportunity with the help of affiliate programs like CPC, pay per click and many more. You can get lot of information about affiliate programs by reading internet affiliate marketing review. The majority of these providers are normally using dedicated servers in order to give their users the speedy access to internet. If you want to select best provider then it is good to read webhosting reviews and blogs in order to get clear idea about webhosting provides rating and their services.
Liked this post? Subscribe, or Share and Enjoy:
  • Digg
  • del.icio.us
  • Blogosphere News
  • Design Float
  • description
  • StumbleUpon
Tags:

30 Comments. Add yours!

  1. Cody
    4:24 pm on June 11th, 2007

    Very informative. Will help beginners out alot.

  2. karan
    12:30 pm on June 12th, 2007

    Nice and helpful article.Thanks for sharing with us.

  3. Jonathan
    5:38 am on June 18th, 2007

    Hi,

    Thanks for your artical, i learnt about DOCTYPE you explained very well.

    Thanks once again,
    jonathan

  4. admin
    10:37 am on June 18th, 2007

    Thanks for your kind replies. A new article is coming up!

    Edit: Visit the new article here!

  5. Erik
    5:17 am on June 21st, 2007

    Maybe you should explain why there are different doctypes and that you should allways try to use Strict.

  6. admin
    5:26 am on June 21st, 2007

    The article is on the ‘DOCTYPE’ subject, not on which language and type you should use. Thanks for your comment.

  7. PiticStyle
    4:47 am on June 23rd, 2007

    thank you for this information!

  8. tovorinok
    1:46 am on July 5th, 2007

    Hello

    Great book. I just want to say what a fantastic thing you are doing! Good luck!

    Bye

  9. diller
    9:40 pm on August 2nd, 2007

    thnx… nice site

  10. diller
    3:55 pm on August 4th, 2007

    nice site… look on my site

  11. Stefan Vervoort
    6:10 am on August 6th, 2007

    Hello,
    Thanks for your comments guys!

    @Music-Band: Thanks for your offer but an adult website isn’t the subject this blog is about. If you have any other sites, other than gambling, adult, we can talk.

  12. Cindi
    7:04 am on August 6th, 2007

    That’s how it is. ,

  13. Fitness
    12:47 am on August 7th, 2007

    Hey, i was surfing the web and i saw your blohg, pretty cool. May i link u from mysite?

  14. mowgli
    3:40 pm on August 18th, 2007

    Thats really cool information about Doc type files…and descriptions…

    Thanks !!

  15. Wahoo
    1:46 pm on October 6th, 2007

    Thank you for sharing!

  16. Simon M Skinner Macdataadvantage
    5:16 pm on May 26th, 2008

    very interesting and informative! tnx pal!

  17. Los Angeles Internet Marketing
    4:55 am on May 27th, 2008

    Thank you very much for your clear explanation of what a DOCTYPE is. I will take a look at my site to make sure I used the right DOCTYPE! Thanks

  18. Shoukath
    1:07 pm on June 20th, 2008

    Nice Article Dude

  19. Siddharth
    9:18 am on August 3rd, 2008

    nice article frnd :)

  20. Blogger Nick
    8:44 pm on August 12th, 2008

    Thanks for the information I never realized that the doc type was used to help render your website with browsers. Now thinking about it makes sense to have somewhat of a universal language that is accepted by multiple browsers.

  21. Internet Marketing Blog
    1:17 am on August 23rd, 2008

    Very informative, I was always looking for a decent article on this subject. I appreciate your information and look forward to learning more from your blog.

  22. community gambling portal
    4:03 pm on August 25th, 2008

    Great information i think most people with sites don’t even realize the importance of this and having a validated website.

  23. www.hitlik.com
    5:09 pm on August 28th, 2008

    Great information i think

  24. Zygor Guides
    8:47 pm on October 11th, 2008

    Well, I havn’t still understood why are people using Transitional DOCTYPES for new projects? How can it make our work easier…

  25. Rowing Machines
    7:57 am on October 20th, 2008

    Very enlightening article, thanks for sharing, this was pretty useful.

  26. Deana
    11:09 am on October 20th, 2008

    I have been a frequent visitor of this blog for some time now, so I thought it would be a good idea to leave you with my thanks.

    Regards,
    Deana

  27. Sumesh
    6:18 pm on October 25th, 2008

    DOCTYPE drove me nuts back when I started validating documents (and did not pass the test), because I had chosen the wrong type for the code I wrote. Looking back, I guess most folks would have done the same. Have you?

  28. Website Design Midlands
    7:17 pm on November 17th, 2008

    I enjoyed reading this article, its very interesting and i really learnt from it. Thanks for this great share.

Trackbacks

  1. A CSS menu with rollovers. by Best Web Design Resources.
  2. A CSS menu with rollovers. » DivitoDesign - Webdesign Blog

leave a reply

This blog is a DoFollow blog. This means your URL counts as a backlink. Some basic HTML is allowed. Please keep all comments constructive, polite and on-topic. Any spam or offensive comments will be deleted.