Thursday, August 11, 2011

HTML5 Tutorial 4: doctype Declaration

<!doctype>

The <!DOCTYPE> declaration must be the very first thing in your HTML5 document, before the <html> tag.
The doctype declaration is not an HTML tag; it is an instruction to the web browser about what version of the markup language the page is written in.

It is important that you specify the doctype in all HTML documents, so that the browser knows what type of document to expect.

The doctype in HTML 4.01 required a reference to a DTD, because HTML 4.01 was based on SGML. HTML5 is not based on SGML, and does not require a reference to a DTD, but need the doctype for browsers to behave as they should.

Using the tag:
The !doctype declaration in HTML5 has been simplified, all you do is place <!doctype html> as the very first line of your document before your <html> declaration like so:
<!doctype html>
<html>
</html>
And you're done!

Catch you guys later.

18 comments:

  1. Good stop if you ever want to learn HTML tricks. Thanks!

    ReplyDelete
  2. this is some good stuff man, nice understandable tips

    ReplyDelete
  3. This makes it so I can finally understand HTML. Thanks!

    ReplyDelete
  4. HTML was always a pain at school, good to see some trying to help others.

    ReplyDelete
  5. I'll be using these to make my blog look a little less blogger-esque lol

    ReplyDelete
  6. Just starting into html again, good stuff.

    ReplyDelete
  7. Thanks again for these tutorials. <3 :3

    ReplyDelete
  8. Very informational and easy to read tutorial! thanks..

    ReplyDelete
  9. HTML 5! I need to learn this, I will visit this site everyday!

    ReplyDelete
  10. God, I'm learning so much form this blog, thanks!

    ReplyDelete
  11. I learnt my lesson with HTML, never again.

    ReplyDelete
  12. good tips, i actually needed help with this stuff
    following

    ReplyDelete
  13. I know a lot of languages, but this one will be new for me :D

    ReplyDelete
  14. ah interesting stuff. i learned html when you didn't have to do a doctype

    ReplyDelete