What Is HTML Tag: Step By Step Guide To HTML Tag

  • Post category:HTML
  • Post author:
  • Post last modified:May 6, 2022
  • Reading time:6 mins read
You are currently viewing What Is HTML Tag: Step By Step Guide To HTML Tag

When you are new to learning HTML obviously you don’t know much about What is HTML Tag. In this chapter, we will briefly talk about what is HTML Tag. Syntax to write an HTML tag, the type of tags, and basic HTML tags. The HTML language is a consists series of HTML tags, that describe a website structure.

HTML tags are well-organized pieces of characters. This helps web browsers properly define the content, which one is a paragraph, and which one is a heading. Tags in HTML start with a less than character (<) and end with a greater than character (>). Tags do not display in browsers, it helps to display the document.

As I discuss at the beginning of this post, HTML tags are a group of characters that helps web browsers properly define the content and give clear information about the document.

<h1>Page Heading</h1>
<p>Here is a paragraph</p>

Syntax Of HTML Tag

Every HTML tag has an opening tag and a closing tag. And the content is written between the opening tag and closing tag.

An HTML opening tag is written between two angle braces “<>“. And the Closing HTML tag is also written between two angle braces “</>” with a forward slash.

Here is an example of how to write an HTML tag.

<opening_tag> content </closing_tag>

<!-- Here we write a p tag to declare a paragraph-->
<p> This is a paragraph </p>

Type of HTML Tags

what is html tag

Tags in HTML are two types container tags and empty tags. Container tags are those tags that have an opening tag and a closing tag. Container tags contain contents between the opening tag and the closing tag.

Empty tags are those tags that do not have a closing tag. Empty tags do not contain the content itself. It contains content using its attributes.

Container Tag

Here <p> tag is a container tag, it has both an opening tag and closing tag. And it contains the text “This is a paragraph”.

<p>This is a paragraph</p>

Empty Tag

Here meta tag is an empty tag, it does not contain any content itself. It contains information through its attributes. This tag contains a page description through its attributes “content”.

bellow we will definitely describe which one is a container tag and which one is an empty tag.

<meta name="description" content="page _description">

HTML Tags Example

Here is an example of HTML tags. An HTML document starts with the <html> tag, it is the root tag of an HTML document. Thereafter the HTML document is divided into two major parts. One is the HTML <head> tag and another is the HTML <body> tag.

The HTML head tag contains the document title, description, metadata, stylesheet, and javascript code. And the body tag contains the document content like heading, paragraph, images, tables, list, etc.

<html>
  <head>
     <title>Page Title</title>
     <style>
     </style>
  </head>
  <body>
     <h1>Heading 1</h1>
     <p>This is a paragraph</p>
     <img src="pic.png">
  </body>
</html>

Chapter Summary

  • HTML tags are well-organized pieces of characters. Which together make meaning for web browsers, and give special instructions.
  • HTML tags are written between angle braces. An opening tag is written between angle braces (<html_tag>) and a closing tag is written between angle braces with a forward slash (</html_tag>).
  • Two types of tags in HTML, Container tag and Empty tag. Container tags contain information between the opening tag and closing tag. And Empty tags contain information mostly through their attributes.

Ashim Khatua

Professionally Web Developer since 2015, And also a Blogger. I am the founder of SiteCodings.com. I love to share my knowledge, which I earned the past few years. I want to share my knowledge with you through my Blog. Keep Reading.

Leave a Reply