What is HTML?
HTML also known as Hyper Text Markup Language is a basic building block of a web development, HTML basically provides a skeleton to the web page which helps users to create a basic webpage.
HTML uses various tags to frame a content accordingly.
What are Tags in HTML:
HTML Tags are the building blocks of HTML, which help users to create a web page. HTML Tags acts like a container that holds different types of content such as text, images, links and much more.
Each tag has a specific purpose and by using these HTML Tags correctly, users can create an appealing web page.
HTML tags are always enclosed in angle brackets (< >). A typical HTML tag consists of an opening tag and a closing tag.
Types of HTML Tags:
HTML Tags can be divided into various types based on different aspects,
In this article we’ve explained different HTML Tags based on various classifications.
-
Paired HTML Tags:
As specified for the name, these tags come in pairs which means these tags contain opening as well as closing tags, with the content placed between them.
Let us take an example to understand it with more clarity:
<p>This is a paragraph in between.</p>
Here <p> is an opening tag for paragraph while </p> is a closing tag for paragraph and the text written in between will be displayed on the web page as a paragraph.
-
Unpaired HTML Tags:
Unpaired HTML tags are also known as self closing or empty HTML tags. These tags do not require any closing tag as they do not contain any content. They are used to insert standalone elements into an HTML document.
Common examples of these tags are:
<img> tag – this is used to insert images in a web page.
<br> tag – this tag is used to break a line.
-
Formatting HTML Tags:
As specified from the name, Formatting HTML tags are used to control the appearance and layout of content on a web page.
Formatting Tag helps to make content on the web page look attractive and insightful. They include tags that can change the style, size, color, and alignment of the text in the web page.
Examples of formatting HTML tags include:
- <b> tag – used to make the text bold.
- <i> tag – used to italicize the text.
- <u> tag – is used to underline the text.
- <s> tag – is used to strike off the text.
Apart from these basic formatting tags, it also provides tags to change font size, font color and font alignment in the web page making webpage more attractive
- Font size HTML tag: The Font tag is used to specify the size of the text in the web page.
User can enter any value from 1-7 based on the requirement
(here 1 stands for smallest and 7 is the largest font size available)
Format for writing this tag is given below for your reference:
<font size=”4″> “This text will have a larger font size” </font>
- Font color HTML Tag: Font color tag is used to change the color of the text in the web page. The color of the font can be Red, Green, Blue or you have to define it in a hexadecimal format like: (#RRGGBB)
Format for writing this tag is written below for your better understanding:
<font color=”blue”> “This text here will be in blue color.” </font>
-
Structure HTML Tags:
Structured HTML tags are the building blocks of the webpage, these tags are used to define the layout and structure of the web pages, also helping browsers to interpret and display the content correctly.
Some basic examples of Structure HTML Tags are:
- <!DOCTYPE> – this tag is used to declare the document type, it should always be placed at the beginning of an HTML document.
- <HTML> – This tag is a must while framing a web page. It defines HTML language and all other <head>, <body> tags are defined after this.
- <Title> – This tag defines the title of the web page which appears in the browsers title bar.
Format for title tag is given below for your reference:
<Title> “write your title here” </Title>
- <body> – This tag contains the main content of the web page, including main texts, images, links and other necessary elements.
Learn HTML with PW skills:
Enrol in our Web Development Course to learn the principles, basics and knowledge of all the tools required for Web development. Whether you are a beginner or an individual looking to switch your career, this full stack development course will be a right fit for you: providing roadmap, and knowledge of all the tools including HTML, CSS, Java Script, interactive classes, practice material, regular doubt sessions and guidance from experienced teachers for your better understanding helps you to get your desired job in the field of web development.
FAQs on HTML Tags
Is body tag in HTML a container tag?
Yes, A body tag in an HTML is a container tag as it contains all the main content displayed on the web page including images, inks, videos etc.
What is the use of tag ?
tag is an empty tag basically used to add an horizontal line on a web page. This tag does not have a closing tag hence it is known as an empty tag.
How to add colors in HTML?
You can add colors in an HTML document by simply using Font color tag, the format for font color tag is given above in the article for your reference.