Loading


HTML Tags are fundamental building blocks of a web page. They serve as instructions for browsers to structure, style and present content. Most tags come in pairs.

  • An opening tag starts an element.
  • A closing tag ends that element, preceded by a forward slash '/'.
Together they define how content appears on various browsers and devices.


Types of HTML Tag



NOTE: Tag name must be in lower case.


1. Opening and Closing Tags

HTML elements generally have an opening tag and a closing tag. The opening tag contains the name of the element, and the closing tag has the same name but is preceded by a forward slash ‘/’.

Example:

<p>This is a paragraph.</p>
<a href="https://www.example.com">Click here</a>

2. Self-Closing Tags (Void Elements) 

Some elements don't require a closing tag and are called self-closing tags or void elements.

Example:

<img src="image.jpg" alt="An image">
<br> <!-- Line break - also a self-closing tag -->

HTML All Tag Lists by Categories


1. Document Structure Tags

These tags define the overall layout or skeleton of the page.


TagDescriptionExample
<!DOCTYPE>Declares the document type-
<html>Root of HTML document<html lang="en">...</html>
<head>Contains meta info, links, title, scripts<head><title>Page</title></head>
<body>Main content of the document<body>Content here</body>
<title>Title shown in browser tab<title>My website</title>
<base>Base URL for links<base href="https://example.com/">
<link>External resources like CSS<link rel="stylesheet" href="style.css">
<meta>Metadata like charset, description<meta charset="UTF-8">
<style>Internal CSS styles<style>
body{
color: red;
}
</style>
<script>JavaScript code or links<script src="app.js"></script>

2. Sectioning Tags

Used to structure the content into logical parts.


TagDescriptionExample
<header>Top section, usually with logo/nav<header><h1>Logo</h1></header>
<nav>Navigation links<nav><ul><li>Home</li></ul></nav>
<main>Main unique content of the page<main><h2>Blog</h2></main>
<section>Thematic grouping of content<section><h2>News</h2></section>
<article>Self-contained content<article><h3>Post</h3></article>
<aside>Sidebar or related content<aside>Ads or tips</aside>
<footer>Bottom section, usually with info<footer>Copyright 2025 MySite</footer>
<address>Contact info<address>Email us</address>

3. Text Content Tags

Tags used for content and text formatting.


TagDescriptionExample
<h1> to <h6>Headings (h1 = biggest)
<h1> Main Title </h1>
<p>Paragraph<p>This is a paragraph.</p>
<br>Line breakLine 1 <br> Line 2
<hr>Horizontal line<hr>
<pre>Preformatted text<pre> Code block </pre>
<blockquote>Quoted section<blockquote> Quoted text </blockquote>
<ol>Ordered list<ol><li> Item </li></ol>
<ul>Unordered list<ul><li> Item </li></ul>
<li>List item<li> Item </li>
<dl>Description list<dl><dt> Term </dt><dd>Definition</dd></dl>
<dt>Term in <dl><dt>HTML</dt>
<dd>Description in <dl><dd> Markup Language </dd>
<figure>Group image/media + caption<figure><img><figcaption> Text </figcaption></figure>
<figcaption>Caption for <figure><figcaption> Description </figcaption>
<div>Generic container<div> Section </div>
<span>Inline container<span> Highlight </span>

4. Text Formatting Tags

Used for styling and emphasizing text.


TagDescriptionExample
<strong>Important text (bold)<strong> Warning! </strong>
<em>Emphasized text (italic)<em> Note this </em>
<b>Bold (no importance)<b> Bold </b>
<i>Italic (no emphasis)<i>Italic </i>
<u>Underline text<u> Underlined </u>
<mark>Highlighted text<mark> Important </mark>
<small>Smaller text<small> Fine print </small>
<del>Deleted text<del>Old price </del>
<ins>Inserted text<ins> New Price <ins>
<sub>SubscriptH<sub>2</sub>o
<sup>Superscriptx<sup>2</sup>
<abbr>Abbreviation<abbr title="HyperText Markup Language">HTML</abbr>
<code>Code text<code>console.log()</code>
<kbd>Keyboard input<kbd>Ctrl + C</kbd>
<samp>Sample output<samp> Hello </samp>
<var>Variable in code<var> x </var> = 10

5. Hyperlink Tags

Used to link content.


TagDescriptionExample
<a>Anchor/link<a href="https://google.com">Google</a>
<area>Image map area<area shape="rect" coords=". . ." href="#">
<map>Image map container<map name="imgmap">. . .</>

6. Media Tags

Handling images, audio, video and embedded media.


TagDescriptionExample
<img>Image<img src="picture.jpg"  alt="Picture">
<audio>Audio player<audio  controls src="sound.mp3"></audio>
<video>Video player<video  controls><source  src="video.mp4"></video>
<source>Media source<source src="file.mp4" type="video/mp4">
<track>Subtitles or captions<track src="sub.vtt"  kind="subtitles">
<embed>External resource embed<embed src="file.pdf">
<object>Embed object<object data="movie.swf"></object>
<iframe>Inline frame (another webpage)<iframe src="https://example.com"></iframe>
<canvas>Draw graphic via JS<canvas id="myCanvas"></canvas>
<svg>Scalable Vector Graphics<svg><circle cx="50" cy="50"  r="40" /></svg>

7. Table Tags

It is used to create and format tables.


TagDescriptionExample
<table>Table container<table></table>
<tr>Table row<tr><td> Row </td></tr>
<td>Table data cell<td> Cell </td>
<th>Table header cell<th> Header </th>
<thead>Header section<thead> . . . </thead>
<tbody>Body section<tbody> . . . </tbody>
<tfoot>Footer section<tfoot> . . . </tfoot>
<caption>Table title<caption> Monthly Sales <caption>
<col>column formatting<col span="2" style="background: yellow">
<colgroup>Group of columns<colgroup><col></colgroup>

8. Form Tags

For creating forms and capturing user input.


TagDescriptionExample
<form>Form container<form action="submit.php"></form>
<input>Input field<input type="text">
<textarea>Multiline input<textarea></textarea>
<button>Clickable button<button> Click </button>
<select>Dropdown list<select><option> One </option></select>
<option>Option in select<option> One </option>
<label>Label for input<label for="name"> Name </label>
<fieldset>Groups related inputs<fieldset><legend> Info </legend></fieldset>
<legend>Title for fieldset<legend> Personal Info</legend>
<datalist>Predefined input values<datalist><option value="HTML"></option></datalist>
<output>Shows result<output>50</output>
<meter>Scalar value indicator<meter value="0.8"> 80% </meter>
<progress>Task progress bar<progress value="60" max="100"></progress>

9. Web Components / Misc Tags


TagDescriptionExample
<template>Template content not rendered<template><p> Hidden </p></template>
<slot>Placeholder in shadow DOM<slot></slot>
<noscript>Content for users without JS<noscript> Please enable JS</noscript>