The doctype declaration
Take a look at this page's "Source Code". In IE on a PC click "View" and then "Source" and the code should open in Notepad or some text editor. In Firefox click "View" and then "Page Source" and it should open in a new window. If you have any problems or are in a different browser search "source code" in help.
At the very top of the page you will see the doctype declaration:
<!DOCTYPE html>
*
As with any language, HTML5 has a grammar and a vocabulary. For example:
- Grammar
<!DOCTYPE html>
goes at the top of every HTML5 page.- Vocabulary
- The HTML5 word
<!DOCTYPE html>
means "this page is written in HTML5" as opposed to, say HTML 4.01.
Why, you ask, don't they just write
<HTML5>
or even a zesty <!HTML5>
? I have absolutely no idea. Still that's better than what they had before. Here's an example of one common type of XHTML:Hopefully the doctype declaration in HTML5 won't turn into the crazy mess it did with XHTML and previous versions of HTML. Those in charge of such things say it won't, but time will tell.
- So now you learned three things:
- 1) How to view the source code of a page, an important tool.
- 2) You know one word in HTML5:
<!DOCTYPE html>
= "HTML5" - 3) and one grammar rule:
<!DOCTYPE html>
goes at the top of every page.
0 comments:
Post a Comment