HTML tags are the building blocks of an HTML document. They are used to create the structure and content of a webpage.
An HTML tag is a keyword surrounded by angle brackets, like <html> or <body>. Most tags come in pairs, with an opening tag and a closing tag. The closing tag has a forward slash before the keyword, such as </html>
or </body>
. The content of the webpage is placed between the opening and closing tags.
An HTML tag must contain three parts:
- An opening tag — this will start with a < > symbol.
- Content — the short instructions on how to display the on-page element.
- A closing tag — this will end with a </ > symbol.
<h1> Heading Tag </h1>
<p> Paragraph Tag </p>
<b> Bold Tag </b>
<i> Italic Tag </i>
<u> Underline Tag</u>
There are different types of HTML tags for different elements of a webpage such as headings, paragraphs, images, links, lists, forms, and more.
HTML tags also can have attributes which provide additional information about the element. For example the <img>
tag has a src
attribute which provides the source of the image and the <a>
tag has a href
attribute which provides the link to the webpage to be opened.
It is important to note that HTML tags are not case sensitive, but it is a good practice to write them in lowercase.
The Most Common HTML Tags
There are many different types of HTML tags that you can use for your web pages. Here is a list of the most common HTML tags:
Tag | Type | What It Is |
<p> | HTML Text Tags | Paragraph |
<h1> | HTML Text Tags | Heading 1 |
<h2> | HTML Text Tags | Heading 2 |
<h3> | HTML Text Tags | Heading 3 |
<h4> | HTML Text Tags | Heading 4 |
<h5> | HTML Text Tags | Heading 5 |
<h6> | HTML Text Tags | Heading 6 |
<strong> | HTML Text Tags | Strong |
<em> | HTML Text Tags | Emphasis |
<abbr> | HTML Text Tags | Abbreviation |
<address> | HTML Text Tags | Contact Information |
<bdo> | HTML Text Tags | Override The Current Text Direction |
<blockquote> | HTML Text Tags | Content From Another Source |
<cite> | HTML Text Tags | Title Of The Work, Book, Website |
<q> | HTML Text Tags | Inline Quotation |
<code> | HTML Text Tags | Display A Part Of Programming Code |
<ins> | HTML Text Tags | Text Inserted |
<del> | HTML Text Tags | Text Deleted From The Document |
<dfn> | HTML Text Tags | Term Defined Within A Sentence/Phrase |
<kbd> | HTML Text Tags | Keyboard Input |
<pre> | HTML Text Tags | Preformatted Text |
<samp> | HTML Text Tags | Sample Output Of A Computer Program |
<var> | HTML Text Tags | Variable Name Used In Mathematical Or Programming Context |
<br> | HTML Text Tags | Single Line Break |
<div> | HTML Text Tags | Division |
<a> | HTML Link Tags | Anchor Tag For A Link |
<base> | HTML Link Tags | Base Url For All Relative Url Within The Document |
<img> | HTML Image And Object Tags | Image |
<area> | HTML Image And Object Tags | Area Of An Image Map |
<map> | HTML Image And Object Tags | Image Map |
<param> | HTML Image And Object Tags | Parameter For An <Object> Element |
<object> | HTML Image And Object Tags | Embed An Object |
<ul> | HTML List Tags | Unordered List |
<ol> | HTML List Tags | Ordered List |
<li> | HTML List Tags | List |
<dl> | HTML List Tags | Description List |
<dt> | HTML List Tags | Term In Description List |
<dd> | HTML List Tags | Definition/Description Of A Term In Description List |
Unclosed HTML Tags
Some HTML tags are not closed, for example br and hr.
<br> Tag: br stands for break line, it breaks the line of the code.
<hr> Tag: hr stands for Horizontal Rule. This tag is used to put a line across the webpage.
HTML Tags HTML Tags HTML Tags HTML Tags
- An HTML tag is a keyword surrounded by angle brackets, like
<html>
or<body>
. - HTML tags come in pairs, with an opening tag and a closing tag.