Thursday, October 10, 2013

Filled Under:

How to give headings in HTML

Hey everyone so far we have learned what html is what is the meaning of markup language and which editors can be used :)
Now we will move on to our next step.Lets get started with the basics of HTML.I will start with very easy and simple examples so that you guys can easily understand and learn :)

On websites you people have seen headings like if you open a page which contains the information about that website like the About us page,on that page you see there is a heading and then underneath that heading there you find information about that site,you might have wondered how did the developer made that heading look bigger than the text written under that heading.Well my friends i will tell you the trick to do that ;) .Below i am writing a small piece of code which is very easy to understand and i will also explain it after i write that code for you people :)


<html>
<body>

<h1>hello everyone</h1>
<h2>hello everyone</h2>
<h3>hello everyone</h3>
<h4>hello everyone</h4>
<h5>hello everyone</h5>
<h6>hello everyone</h6>

</body>
</html>

So in order to code in HTML first you need to start with the HTML Tag which is <html> and then you give the body tag <body> which means you will write something inside the body for example here you gave headings :) ,in simple words <body> defines the body of the document :).After you are done writing your html code you need to close the tags as well just put forward slash like this </body> </html>
In the same way if you want to give a heading you need to give the heading tag which is <h1> or <h2> or <h3> or <h4> or <h5> or <h6> .And then after completing the heading you need to close your tag as well </h1> or </h2> or </h3> or </h4> or </h5> or </h6> :)

Q: Why are you using a number inside your tag like <h1> or <h2> ?

Ans: This number defines the size of your heading.For example if you will write 2 headings one in h1 tag and the other in the h2 tag,the size of the h1 heading will be bigger than the size of the heading in the h2 tag :) and in the same way the size will decrease :) h3 will font will be smaller than the heading in the h2 tag,in html we have heading sizes up til 6 :)

When you are done writing this code just save this file and give a name to it for example myheadings and then type . and type html,like this myheadings.html
Now when you will save it you will see the name of your file under your browser icon when you will double click on myheadings.html it will open in the browser displaying the names of your headings :) .In case if you are still seeing just the notepad file just write click on the file and click on Open with and choose a browser :)

Step 1:



Step 2:

 Step 3:







0 comments:

Post a Comment