Saturday, October 12, 2013

Filled Under:

How to give hyperlink in html

Hey everyone our today's topic is the <a> tag.

Q:What does <a> tag do?

Ans: This tag is used for giving link,say for instance if you want to make a home page where you will write information about your website and you want to make another page for providing your contact information so that when the user clicks on the home page it should open a page where there is information about your site and if the user clicks on the contact page it should contain the contact information.This can be done by using the <a> tag,this tag is used for creating a page where user can click and open up a page,this tag can also be used for providing other things as well,like if you want to put a document on your site so that when user clicks on it the user can download that document.So guys the purpose of <a> tag is to give a link.

Lets get started with the code.Now friends for giving links on your website all you need to do is open up the <a> tag put the URL of the page your want to open when clicked on it,give a name to the page so that it is visible and understandable for the users and close the tag.Below i am writing a small piece of code and i will also explain it line by line after i am done writing it.


<html>
<body>

<a href="https://www.google.com"> Google</a>
<a href="https://www.facebook.com">Face Book</a>
</body>
</html>

So friends what i did in this code is first i opened my html and body tags,opened up the <a> tag,gave 2 links of the famous and well known sites,put a name to it and closed the tag </a>,and at the end i closed the html and the body tag.
When you will click on Google the browser will load the google page,and if you will click on facebook the browser will open the facebook log in page.Now let me give you guys a little demo of how this code works.








0 comments:

Post a Comment