HTML Tags – What are HTML Tags

HTML tags: If you need to display content properly on your web page then you will have to use the Tags.

If you don’t use the tags then Everything will look similar. This means that there will not be a difference between the heading and the paragraph. Even the text format will be the same.

html tags


What are HTML Tags

  • The HTML tag is the predefined name of content or documents.
  • HTML tag name is covered with two angle brackets.
  • HTML tags are helpful to display content or document in a proper format.
  • HTML tags tell the web browser how to display content.
  • The Web browser does not display HTML Tags

HTML Tag Syntax

Here is the syntax of HTML tags –


Where –

  • – Left angle bracket
  • tagname – Predefined name of the Tag
  • – Right angel bracket

Note –

HTML tags are not case-sensitive. This means that you can write tagname in lowercase, uppercase, or camelcase.

According to the coding standard, You should always write tags in lowercase.

  • <tagname> – Lower Case ( Recommended)
  • <TagName> – Camel Case
  • <TAGNAME> – Upper Case

HTML Tags Example

The predefined name of each HTML tag is taken from the first letter of the document. So, that developer can easily remember.

For Example –

  • The tag name of the head – <head>
  • The tag name of the title – <title>
  • The tag name of Body- <body>
  • The tag name of the first heading – <h1>
  • The tag name of the second heading – <h2>
  • The tag name of the third heading – <h3>
  • The tag name of the fourth heading – <h4>
  • The tag name of the fifth heading – <h5>
  • The tag name of the sixth heading – <h6>
  • The tag name of the paragraph -<p>
  • The tag name of the table – <table>
  • The tag name of an ordered list – <ol>
  • The tag name of the unordered list – <ul>
  • The tag name of the image – <img>

Note – There are many HTML tag names which we will learn in the next tutorials

Basic HTML tags List

Here is the basic HTML tag list that are very useful to create a simple web page.

HTML Tags Tag Name
<head></head>Head Tag
<title></title>Title Tag
<body></body>Body Tag
<h1></h1>H1 Heading Tag
<p></p>Paragraph tag
<img>Image Tag
<table></table>Table Tag
<ol></ol>Ordered List
<ul></ul>Unordered List

Types of HTML tags

Four Types of Tags are defined in HTML –

  • Open Tag
  • Close Tag
  • paired Tag
  • Unpaired Tag

Now, Let’s go to understand each tag one by one in the separate steps

HTML – Open Tag

Open Tag is defined to start the section of a document.

Open tag contains angle brackets and tag name.

Open tag is also known as a start tag, and beginning tag.

Syntax –


HTML – Close Tag

Close Tag is defined to end the section of a document.

The close tag contains angle brackets, tag name, and a single forward slash (/)

A close tag is also known as an end tag.

Close Tag always comes with an open tag.

Syntax –


HTML – Paired Tag

The combination of the open tag and closing tag is called the paired tag.

Paired tags indicate where the content of a document begins and ends.

<tagname>Some Text </tagname>

Example –

<h2>Second heading text<h2>
<p>Some paragraph text</p>

HTML – Unpaired Tag

An unpaired tag does not have a closing tag. It only comes with the open tag.

Image, Input Field, Line Breaking, Horizontal line etch these all types of content come with the  Unpaired tag.

An unpaired tag closes itself. So, It is also known as Self Closing Tag.

Syntax –


You should add a forward slash (/) at end of the open tag to define self-closing.

<tagname />

Example –

<hr />
<br />
<img src="" />
<input type="text" />

Usage of HTML Tags

To use HTML Tags, We can –

  • display Content/documents in a proper format.
  • create navigation links to go from one page to another page.
  • create a table to display data in a tabular format.
  • create a list to display data in a list format.
  • display images on the webpage
  • create many forms such as Registration Form, Login Form, Contact Form, Feedback Form, Comment Form, etc
  • make Video Player and Audio Player.

Above, we informed you about the use of some important  tags. You can do even more with tags. You’ll learn more about its uses as you progress.

Advantages of HTML Tags

  • It is very simple to learn tags
  • Tags support all types of web browsers.
  • Tags are compatible with other Web Languages (CSS, JavaScript, PHP, & more).
  • text of Tags can be opened in the web browser without connecting to any internet connection

Disadvantages of HTML Tags

  • Tags can’t work as a programming language. because it has no conditions & logic.
  • Tags can’t make dynamic content. Means that It can not display content on the user request.
  • Tags can’t make attractive content or web page without using CSS.
  • The layout and content made of tags may look different in different web browsers.