Warning:
This wiki has been archived and is now read-only.

Educational materials/HTML Document

From HTML Wiki
Jump to: navigation, search

HTML Document

The following example is basic HTML document:

<!doctype html>
<html lang=en>
<head>

  Document metadata

</head>
<body>

  Document contents

</body>
</html>

Description

doctype

The DOCTYPE must be specified, and be top in the HTML document. That is, the DOCTYPE exists before the <html> start tag.
The DOCTYPE declaration is <!DOCTYPE html> and is case-insensitive in the HTML syntax.

<!DOCTYPE html>

     or

<!doctype html>

See also 2.2 doctype(HTML5 differences from HTML4).

html element

The html element represents the root of an HTML document.

  • The html element usually has the lang attribute. The lang attribute Specifies the primary language for the contents of the element.
  • The <html> ... </html> contains a head element followed by a body element.
<html lang="en">

</html>

See also The html element

head element

The head element represents a collection of metadata for the Document.

  • The <head> ... </head> contains the title, and information on style sheets and scripts.
  • Contents in the head tag are not displayed on a Web browser.
<head>

</head>

See also The head element

body element

The body element represents the main content of the document.

  • The <body> ... </body> contains the markup with the visible content.
<body>
  <p>Here is the visible content</p>
</body>

See also The body element


These tag composes the base of HTML document.
The next chapter introduction the "document metadata".