HTML Tags

HTML tags are playing an important role in building a webpage. Based on its application various tags are available, we will learn all tags available in HTML 5 as a separate unit and we will also take the example of all tags. In this unit, we will learn some basic tag rules.

Types of HTML Tags

There are two types of tags:

  1. Paired Tags
  2. Unpaired Tags

Paired tags are also known as a container tag. It holds data between the opening and closing of the tag. The opening tag indicates starts and closing tag indicates the end of tags. For example to bold text we can use <b>some text</b> tag. In this example <b> is opening tag and </b> is closing tag.

Unpaired tags are also known as an empty tag or standalone tag. They don't have a closing tag. To use line break we have an html tag <br /> we can use that code as <br> or <br /> but <br /> is correct way. Similarly we can also use <hr> or </hr>for horizontal line , and we don't need any companion tag.

HTML is case insensitive

You can use <b>some text</b> or <B>some text</B> it will give same output. But W3C has recommanded to use only lowercase tags.