HTML Syntax

HTML tags start with a less than bracket < and end with greater than bracket >, and between the brackets you specify the element. Most of the HTML tags come in pairs, so you have to specify the start and ending. The end tag has a forward slash prefixed, for example like this:

<p>This is a paragraph tag.</p>

Although most tags come in pairs some don’t; in that case you simply insert a forward slash after the element like this:



To specify a comment you use the less than bracket < followed by an exclamation mark ! and then two dashes –. To end the comment you use two dashes followed by a greater than sign, for example:

<!-- This is a HTML comment -->

HTML comments are ignored by browsers and they will not be displayed to the users, but remember that users can still view the source. Do not store any private information here!

Global Structure


      <title>Document Title</Ttitle>
      <p> Your content </p>

An HTML 4.01 document consists of 3 parts, the DTD (Document Type Declaration), <head> content and <body> content.

The DTD is not an HTML tag, but is used to specify the type of document. In this case it is an HTML document. The DTD is required.

The <head> tag contains information about the current document, information such as <meta> content, <link> and document <title> (we will cover these tags later). The <title> tag is required, as it specifies the document title that is seen in  the SERP (Search Engine Results Page) and browsers. Give a clear indication of the document when providing a <title>. The <title> tag can only be declared once in a document.

Lastly, the <body> tag is where the content which will be rendered by the browser and is visible to the user is placed.