HMTL Basic Structure

Every HTML document at least should include the following tags:

  • html tag
  • head tag
  • title tag
  • body tag

The basic structure of HTML Document code looks like the following:

The first line of the code determines that it is an HTML document.

The second line of the HTML document is opening of the html tag <html> and the last line is closing of the html tag </html>. HTML tag is the top most element and all the other tags and attributes are nested within these tag.

A tag is always opened using the symbol < > and must always be closed using the symbol </ >. These symbols <> </> contain tags in between them. However, there are few tags that do not require the closing tag </>.

Tag or Tag Element

Tag or Tag element refers to the codes that define the element in HTML file. HTML tags are inserted in between the symbols of <>. Tags are of two types:

  1. Container Tag: These tags are those tags which consist of start and end tags.
  2. For instance, <html> is the starting tag and </html> is the ending tag.

  3. Empty Tag: These tags are standalone element and have only starting tags.
  4. For instance, <br> is the only tag and does not have its ending tag and <P> is the only tag and does not have its ending tag.

HTML Head Tag

Head tag gives information about your html file, it is nested within html tag. Usually, the title tag is the only tag which is nested within the head tag.

HTML Title Tag

Title Tag comes after the head tag. It should be included in every html document as it identifies page to the rest of the world. Its output does not appear as a part of the page but it is displayed on the browser’s title bar. If this tag is not coded then some browsers may show it as ‘Untitiled’ whereas in others just URL for the page on the title bar of the browser.

HTML Body Tag

Body tag is the compliment of the head tag and contains all of the tags, or elements that a browser actually displays as the body of your html document.

HTML is not case sensitive

The HTML code is not case sensitive, meaning <html> and <HTML> are same.

The standard HTML code follows lowercase tags because it is recommended by W3C (World Wide Web Consortium).