Setting Up the Basic Document Structure

Setting Up the Basic Document Structure

The html element

The html element, which is more properly called the root element, indicates the start of the HTML inside of your document.

<!--Using the html Element-->
<html>
...content and elements omitted...
</html>

The head element

The head element contains the metadata for the document. In HTML, metadata provides the browser with information about the content and markup in the document, but can also include scripts and references to external resources (such as CSS stylesheets).

<html>
  <head><title>Hello</title>
  </head>
</html>

The body element

The body element encapsulates the content of an HTML document, as opposed to the head element, which encapsulates metadata and document information. The body element always follows the head element so that it is the second child of the html element.

Setting the document title

The title element sets the document’s title or name. Browsers usually display the contents of this element at the top of the browser window or tab.

Using the head element