Basic structure of an HTML document

An HTML document has two* main parts:

  1. head. The head element contains title and meta data of a web document.
  2. body. The body element contains the information that you want to display on a web page.

* To make your web pages compatible with HTML 4, you need to add a document type declaration (DTD) before the HTML element. Many web authoring software add DTD and basic tags automatically when you create a new web page.

In a web page, the first tag (specifically, <html>) indicates the markup language that is being used for the document. The <head> tag contains information about the web page. Lastly, the content appears in the <body> tag. The following illustration provides a summary.

Summary of Basic HTML Tags
Summary of Basic HTML Tags