HTML Tags

In this tutorial, you will learn about most commonly used tags in HTML.

Most commonly used tags in HTML


HTML document contains lots of predefined tag and we will learn about few of them here:

HTML Tag is a command which is used for some specified purpose and those purposes are predefined by default. With the help of tags, web browser can distinguish between an html content and a simple document. Tag mainly consists of three parts: opening tag, content and closing tag. In case of few tags we have exception, they do not have closing tag.

Content : Content is the matter which we write between opening and closing tags.

Syntax


<tag> content </tag>

We have 2 types of tags:

1. Paired Tag : These tags come in pairs. That is they have both opening(< >) and closing(</ >) tags.
2. Unpaired Tag : These tags do not required to be closed.

We will go through basic tags required to create a html document.
<html>
Defines an HTML document.

<head>
This contains the information about the HTML document. For example, Title of the page, version of HTML, Meta Data(data for search engine) etc.

<body>
Defines the document's body. Used to give content to our web page which we want to display on browser.

<p>
Defines a paragraph of text. Browsers automatically add a single blank line before and after each <p> element.

<b>
Used to highlight in bold some part of the text.

<i>
To display content in italic style.

<s>
The <s> tag specifies text that is no longer correct, accurate or relevant. The text will be displayed with a line through it. For example, you have seen product prices strike out during Sale period to reflect discounted price.

<hr>
Used to insert horizontal rule in an HTML page.

<pre>
Defines the preformatted text. Text in a <pre> element is displayed in a fixed-width font, and the text preserves both spaces and line breaks. The text will be displayed exactly as written in the HTML source code.

<big>
Used to increase the text size.

<small>
Used to decrease the text size.

<center>
Used to set alignment of the text in center.

<sup>
Defines the superscript text like in powers in mathematics.

<sub>
Used to add subscript text like chemical formula in chemistry.

&nbsp; 
To give space between text in an HTML page. One &nbsp; means one space.

For live demo, go though below Youtube video:




Comments

Popular Posts

How to Import and Export Delimited Files, like CSV, in PowerShell

How to generate a GUID in PowerShell

PowerShell Arithmetic Operators