HTML Tag

|

What is an HTML Tag?

HTML tags are made up of three parts: the opening tag, the content, and the closing tag. They are the building blocks of a web page. They are used to display different elements such as text, images, links, headings, and paragraphs in an organized way. They help the browser understand how to show content properly so users can easily read and view it. This makes the web page more readable and structured.

Syntax:

<tagname>Content</tagname>

Components of an HTML Tag:

<p>
This is a paragraph
</p>
▲
Opening Tag
▲
Content
▲
Closing Tag

1. Opening Tag:

An opening tag is like an open door or the main gate of a house. Just as an open gate allows you to enter a house, an opening tag tells the browser where an HTML element starts. In HTML, there are many different opening tags, and each one is used for a specific type of content. For Example:

<p>
<div>
<a>
<ul>
<table>
......
.....

2. Content:

Content is the text, information, or other material placed between the opening and closing tags of an HTML element. It is the part of the element that is displayed on the web page.


3. Closing Tag:

A closing tag works like closing the door or gate of a house. It tells the browser where the HTML element ends. A closing tag is written with a forward slash (`/`) before the tag name. For Example:

</p>
</div>
</a>
</ul>
</table>
......
.....

HTML Tags:


1. Paired Tags

2. Unpaired Tags / Void Elements


  1. Paired Tags: These tags come with both opening and closing tags.

    Example:

    <p>This is a paragraph tag.</p>

  2. Unpaired Tags / Void Elements:

    Some HTML elements do not have content or a closing tag. These elements are called void elements. For example, the <img> element is used to display an image and does not have a closing tag.

    Example:

    <img src="image.jpg" alt="Example Image">
    <img>

ONLINE WEB TOOLS

WhatIsMyIpAddress
Shorterner
Web Services