Basic Html Tags

March10, 2018
by admin

In the last section, we have seen about heading html tags. Let’s now see some basic html tags.

First, copy our basic html template and create a new file named as ‘basics.html’ in your choice of editor. Within the body add the following content.


<p>
What is an Html?
</p>

<p>
Html is an abbreviation of hypertext markup language. 
It is NOT a programming language but a markup language where you write some html tags with content and save it as html or htm file. 
Then this file you can open in any browser which will show you the output.
</p>

Look at the above html content. It has some content in two paragraphs.

Now let’s do some basic formatting to it.

First, let’s make the question in first paragraph bold. Change it using either ‘<strong>’ or ‘<b>’ tag.

<strong>What is an Html?</strong>

OR

<b>What is an Html?</b>

Let’s make the word ’NOT’ in second paragraph italic. To do this we can use italic html tag as follows.

<i>NOT</i>

To give underscore to any word or words or a complete sentence use underscore html tag.

Let’s give underscore to html or htm words in the second paragraph as follows.

<u>html</u>

<u>htm</u>

Suppose, if we want to give a line between question and answer then we have to use the horizontal rule <hr> tag.

Note that this tag doesn’t have a closing tag. Put this tag after first paragraph closing tag.

With all these modifications our code is now as follows.


<p>
<strong>What is an Html?</strong>
</p>

<hr>

<p>
<u><b>Html</b></u> is an abbreviation of hypertext markup language. 
It is <i>NOT</i> an programming language but a markup language where you write some html tags with content and save it as <u>html</u> or <u>htm</u> file. 
Then this file you can open in any browser which will show you the output.
</p>

Save our modified code and then preview it in a browser by clicking preview icon from a right-hand panel of the editor as usual. You will see the following output.

One more tag I want to mention here is if we want to quote the question (though this is not the perfect example of a quote it just for our demonstration) then we can use html tag as follows.

<blockquote>What is an Html?</blockquote>

With this change, our content will be displayed in a browser as follows.

In this section, we have learned some basic but useful html tags.

Html