Basics : Lesson 1

In this lesson, you will learn these tags.
Heading: <h1>, <h2>, <h3>, <h4>, <h5> and <h6>
Paragraph: <p>
Line break: <br>
Center: <center>
and Ruler Line: <hr>

Review of tags

Each tag starts with <tag name> and ends with </tag name>.
There is exception for couple of tags as they are used alone not in two parts (starting and ending). These are <br> and <hr>. But they are always written as <br /> and <hr /> to not to confuse the browser.
Now lets first see the output then I shall explain these tags.

Lets see this output with tag names.

Here is the code of this page:

<html>
  <head>
    <title>Lesson 1</title>
  </head>
  <body>
    <h1>This is Heading h1</h1>
    <h2>This is Heading h2</h2>
    <center><h3>This is Heading h3 and centered</h3></center>
    <h4>This is Heading h4</h4>
    <h5>This is Heading h5</h5>
    <h6>This is Heading h6</h6>
    <p>She glanced all around. Till the far end, as her site goes, there was no visible sign
of the living being. Making sure that there is nobody around, she picked up the suitcase 
kept on the adjacent seat and placed it on her lap. She tapped tentatively on the briefcase
few times, as if making the decision firm. Once she was firm about the decision, she quickly
threw the briefcase out of the window, in the direction of the tree. She threw it so quickly 
that, as if she was feared and doubtful of reverting her own decision. "Thud" the sound came, 
and at the same time the crushing sound of the dry leaves came.</p>
    <hr />
    <p>She glanced all around. Till the far end, as her site goes, there was no visible
sign of the living being. Making sure that there is nobody around, she picked up the
suitcase kept on the adjacent seat and placed it on her lap. She tapped tentatively on 
the briefcase few times, as if making the decision firm.<br /> Once she was firm 
about the decision, she quickly threw the briefcase out of the window, in the direction
of the tree. She threw it so quickly that, as if she was feared and doubtful of reverting 
her own decision. "Thud" the sound came, and at the same time the crushing sound of 
the dry leaves came.</p>
  </body>
</html>

Now, as you can see that <h1> .. <h6> are Heading Tags. <h1> is the biggest font size and <h6> is the smallest font size.

To center text, we use <center> tag.

<p> is for paragraph. When we end paragraph with </p>, a new line is inserted by default.

<hr /> is to draw a Horizontal Line. Used to differentiate text, topic, chapter etc.

<br /> is used to break the line and start from the next line. As you can see that when I used <br /> after '.... as if making the decision firm.' next sentence started at New Line.

So, in this lesson you learned these tags:

Heading: <h1>, <h2>, <h3>, <h4>, <h5> and <h6>
Paragraph: <p>
Line Break: <br />
Center: <center>
and Ruler LIne: <hr />
In the next lesson, you will learn tags for block quote, links, comments, and how to write special characters.

Basics  1  2  3  4  prev  next