Wednesday, 26 March 2014



In our previous blog, we’ve told what HTML really is along with the very basic pre-requisite of it. And now we’ll start with the basic working of HTML and how HTML codes are generated.
HTML (Hyper Text Markup Language) is used almost every day by us in our day to day life and one such example is the World Wide Web (www). Everything in internet consists of HTML and HTML links..
So, starting with the basic program. Initially we start with giving HTML file a name.
For example we want to create a HTML file which will display one heading and a part of a paragraph.
So the syntax will be:
<!DOCTYPE html>
<h1>My First Heading</h1>
<p>My first paragraph.</p>
Output is:

My First Heading

My first paragraph.

Anything which is written between <h1> and </h1> will be the heading and anything written between <p> and </p> will be part of paragraph.
You can put up any number of heading and paragraphs.
<h1> means the first heading n will be the biggest in size. To put up a smaller heading keep on incrementing the number and size of heading will reduce. For example <h2> heading will be smaller as compared to <h1> heading and so on.
This can be seen with the following source code:
<!DOCTYPE html>
<h1>This is heading 1</h1>
<h2>This is heading 2</h2>
<h3>This is heading 3</h3>
<h4>This is heading 4</h4>
<h5>This is heading 5</h5>
<h6>This is heading 6</h6>

The output will be:
This is heading 1
This is heading 2
This is heading 3
This is heading 4
This is heading 5
This is heading 6

This way we can display anything we want in our HTML page. Hope this tutorial helps you.

No comments:

Post a Comment