Monday, 19 August 2013

HTML Document Structure & Syntax

All HTML documents have a required structure that includes the following declaration and tags: doctypehtmlhead, and body.
The doctype declaration is used to instruct web browsers which version of HTML is being used and is placed at the very beginning of the HTML document. Following the doctype declaration, html tags signify the beginning and end of the document.
The head of the document is used to outline any meta data, the document title, and links to any external files. Any context included within the head tags is not visible within the actual web page itself. All of the content visible within the web page will fall within the body tags.
A general HTML document structure looks like the following:
  1. <!DOCTYPE html>
  2. <html lang="en">
  3. <head>
  4. <meta charset="utf-8">
  5. <title>Hello World</title>
  6. </head>
  7. <body>
  8. <h1>Hello World</h1>
  9. <p>This is a website.</p>
  10. </body>
  11. </html>