Paired Tags, Unpaired Tags and HTML Comments.

Paired Tags, Unpaired Tags and HTML Comments

Paired Tags, Unpaired Tags, and HTML Comments:

Today we will discuss Paired Tags, Unpaired Tags, and HTML Comments. You will learn about Paired Tags In HTML, What are Paired Tags in HTML, How to use Paired Tags in HTML, next you will learn about UnPaired Tags in HTML OR Singular Tags in HTML, How to use it and what is an example of Unpaired Tags or Singular Tags. In the end, you will also learn about HTML comments, How we can comment on any HTML document or how to do documentation with the help of HTML comments.

Recommend Book for Learning HTML:

What are HTML Tags?

A tag is a unit of markup, a set of symbols defined in the HTML document, to have special meaning. Tags start with a less-than sign (<) followed by a keyword (e.g: b, br, p, body, HTML, header, footer etc.) and concluded or ended with a greate-then sign (>). The symbol great-than and less-than are called angle brackets.

For example, these are all tags

Every Tag in HTML has a meaning and it’s usually pretty straightforward. For example, <B> is a tag that means to switch on bold text and <HR> is a tag that inserts a horizontal rule/line (A rule is a just fancy name for decorative line).

Types of HTML Tags

There are two types of tags: start tags and end tags. Start tags are used to begin an effect, and end tags are used to end that effect. End tags always repeat the keyword with a slash (/) in front.

For example, text to be displayed in bold is enclosed between the <B> start tag and </B> end tag, like this

After rendering this text by the browser, it will look like:

I hope you will Learn about the paired tag and unpaired tags in HTML.

Paired Tags:

A tag is said to be a paired tag if the text is placed between a tag and its companion tag. In paired tags, the first tag is referred to as Opening Tag and the second tag is referred to as Closing Tag.

Example of Paired Tags in HTML:

Note: Here <p> is called opening tag. and </p> is called closing tag.

Unpaired Tags:

An unpaired tag does not have a companion tag. Unpaired tags are also known as Singular tags or Stand-Alone Tags.

Example of Unpaired Tags in HTML:

etc. These tags does not require any companion tag or any closing tag.

Below is the list of unpaired tags in HTML:

HTML Comments:

Comments are not displayed in the browsers. You can use HTML comments to explain your code, which can help you when you edit the source code at a later date. This is especially useful if you have a lot of code.

Previous Lecture Next Lecture

Aizaz Ali