- A main heading,
- Sub headings,
- Paragraphs,
- Breaks,
- Some quotations or proverbs.
- Poems.
Writing in the above format is very easy on a paper. But what if we have to display the essay in a web page then how do we write it in the HTML document?
You need not worry about this. HTML has many inbuilt tags which differentiates each item.
For example <p> </p> tag is used to define the paragraph. So we will cover about these tags in the following example.
<html>
<head><title>An Essay</title></head>
<body>
<h1 align="center"> main heading </h1>
<h2 align="left"> paragraph tag</h2>
<p> This is how a paragraph is written. It is written between the p tags. It has a corresponding closing tag </p><p> For every p tag one empty line will be inserted below and above it. h1 to h6 are the tags used for headings. h1 is the largest and h6 the smallest</p>
<h2 align="left">Inserting empty lines in paragraph</h2>
<p> br is the tag used for inserting breaks. It is similiar to our line breaks. It is like pressing the Enter key in the keyboard to go to the next line.In html we insert br tag whenever we want to insert an empty line. br tag does not have any corresponding closing tag</p>
<h2 align="left">quotes or proverbs and comments</h2>
<p> Usually the proverbs or quotes are written inside blockquote tag. For example <blockquote>Live as if you were to die tomorrow. Learn as if you were to live forever.</blockquote>
<h2 align="left">horizontal lines and poems</h2>
<p> For writing poems we can use the pre tag. This tag displays whatever we write in between it in the same way. But paragraph tag cannot do the same thing for us. It counts any number of spaces in between two words as one space only but pre accepts in whatever format we write.For example I had written below a poem in both the p tag and pre tag. We can see that pre displays it in the written format whereas paragraph doesn't.
horizontal lines can be drawn between paragraphs using hr tag.I had drawn a horizontal line between the p tag and pre tag using hr tag</p>
<hr>
<p> The below written in p tag doesn't format the poem.
The woods are lovely, dark and deep,
But I have promises to keep,
And miles to go before I sleep,
And miles to go before I sleep. </p>
<hr>
<pre> The below written in pre tag formats the poem
The woods are lovely, dark and deep,
But I have promises to keep,
And miles to go before I sleep,
And miles to go before I sleep.
</pre>
</body>
</html>
Copy the above example in red color and save it as a html document with .htm or .html extension.Open it in internet explorer and the web page will explain you the above tags in detail.
A recap of the tags used in the above example is given in the table below.
| START TAG | DESCRIPTION | END TAG |
|---|---|---|
| <p> | Paragraphs are written inside the p tags | </p> |
| <h1, h2, h3, h4, h5, h6> | These tags are used for headings with h1 being the largest size and h6 the smallest size. | </h1 or h2 or h3 or h4 or h5 or h6 > |
| <hr> | Used for drawing horizontal lines | </hr> |
| <br> | Used for inserting empty lines | </br> |
| <pre> | Displays the text as it is. Can be used for writing poems or computer codes | </pre> |
| <blockquote> | Used for writing quotations or proverbs | </blockquote> |
| <!-- any comment > | Used for inserting comments in the document. This will be ignored by the browser and will not be displayed on the web page.It is for programmers understanding |






