HTML - Document

> (World Wide) Web - (W3|WWW) > HyperText markup Language (HTML)

1 - About

An HTML document consist of a tree of elements and text. The specification defines a set of elements that can be used in HTML, along with rules.

An HTML document is also known as a Web Page.

Every XML and HTML document in an HTML UA is represented by a Document object.

2 - Address

The URL associated with a Document is the document's address.


4 - Semantics

Elements represent things; that is, they have intrinsic meaning, also known as semantics. For example, an img element represents an image.

5 - Structure

<!-- tells the browser what language it's reading -->
<!DOCTYPE html>
<!-- Starts the HTML document -->
  <title>Sample page</title>
  <h1>Sample page</h1>
  <p>This is a <a href="demo.html">simple</a> sample.</p>
  <!-- this is a comment -->
<!-- Ends the HTML document -->


There are always two parts to the file:

  • the head: The head includes metadata information about the web page, such as its title.
  • and the body. The content in the body is what will be visible on the actual page.