Basic html tags

 

This  section is about basic html tags , basic html tags about how display simple text in different  formatting on web.

you can read our previous HTML tutorial

What is HTML

 

HTML Heading tag

HTML heading tag are use to give heading to document , html has 6 levels of heading . HTML heading tag display text at different sizes. H1 is largest size and H6 is smallest size . H1 is used for main heading and h2 is used for subheading .

H1 and h2  are also most important tag as SEO point of view because Google’s crawler give them more importance , so always write important text in h1 and h2 tag.

 

Syntax:

<h1>My First Heading</h1>

<h2>My 2nd Heading</h2>

<h3>MY Third Heading in web page</h3>

<h4>My fourth Heading in web page</h4>

<h5>My fifth heading </h5>

<h6>My last heading</h6>

 

Paragraph

To create Paragraph , surround words that make up paragraph with a opening tag <p> and closing tag </p> .

Syntax :

<p></p>

 

Bold <b> :

To display  text in bold format   on webpage , enclose text in <b>Text </b>, text will display in bold format .

HTML Code:

<b>This text will display Bold on Webpage</b>

 

Italic <b>:

To display  text in italic format on webpage ,  enclose text <i>Text </i> , text will display in italic format .

HTML Code for Italic

<i>This text is about Italic tag</i>

 

Superscript :

Superscript tag is used to enclose characters that should be superscript such as Math concept like power on numerical value or suffix of dates .

HTML Code:

<sup></sup>

<span>3<sup>3</sup> =27; </span>

<span>This is my 1<sup>th</sup> html sup script</span

 

Subscript :

Subscript tag is used to enclose char that should be subscript . this tag is mostly used to write chemical formulas .

<sub></sub>

 

<br> tag  : Line Break

By default browser display each new heading or paragraph on horizontal  line. But If you want to add line break between any text , you can used this tag .

<h3>This tag is about br <br>This text will break</h3>

 

<strong> html tag:

If you want to highlight any text ,you can use <strong> tag  text between <strong>text </strong>

Will display  bold.

<span>Object Oriented <strong>Programming Language</strong> </span>


 

<abbr> html tag:

If you want to add abbreviation with any text , <abbr> tag can be use for this purpose .

<span><abbr title="Object Oriented Programming Language">OPP</abbr></span>

A title attribute in opening tag is used to specify full term .

<address> tag :

This is used to contain address information about author of page, like phone number , email  and home address.

<address>

 <span>0310366622</span><br>

<span><a href="mailto:m.sufyan00765@gmail.com">Mail me</a></span><br>

<span>Lahore , Pakistan</span>

</address>


 

<U> underline :

<u> tag is used to underline any text . text between <u></u> will be underline.

<p> I love my country <ul>Pakistan</u></p>

 

<del> tag:

<del> html element  is used to show that text has been deleted . text b/w <del></del> will show as it is deleted.

<p> Delete element in html <del> Deleted </del>/

 

<s> html tag :

This tag indicate something that is no longer relevant  but not deleted.

 

<span><s>Old Price 1000PKR</s></span><br>

<span>New Price 800PKR</span>

 

Complete HTML code :

<html>

<head>

<title>Text</title>

</head>

<body>

<h1>My First Heading</h1>

<h2>My 2nd Heading</h2>

<h3>MY Third Heading in web page</h3>

<h4>My fourth Heading in web page</h4>

<h5>My fifth heading </h5>

<h6>My last heading</h6>

<b>This text will display Bold on Webpage</b><br>

<i>This text is about Italic tag</i><br>

<span>3<sup>3</sup> =27</span><br>

<span>This is my 1<sup>st</sup> html sup script</span><br>

<h3>This tag is about br <br>This text will break</h3><br>

<span>Object Oriented <strong>Programming Language</strong> </span>

<span><abbr title="Object Oriented Programming Language">OPP</abbr></span><br>

<address>

 <span>0310366622</span><br>

<span><a href="mailto:m.sufyan00765@gmail.com">Mail me</a></span><br>

<span>Lahore , Pakistan</span>

</address>

<span> I love my country <ul>Pakistan</u></span> <br>

<span> Delete element in html <del> Deleted </del><span><br>
 <span><s>Old Price 1000PKR</s></span><br><br>

<span>New Price 800PKR</span>

</body>

</html>

 

You can read our next HTML Tutorial

How to create list in HTML

How to create table in HTML

How to insert images in HTML

Leave a Reply

Your email address will not be published. Required fields are marked *