Linking in HTML

More options for you.


General KnowledgeEnglish GrammarMathScienceIQ-TestQuiz-Test

We will learn all about link in this chapter.
HTML links are hyperlinks, a hyperlink may be a text or an image.
HTML link is very important things for web site and for your users too.
Users can visit your multiple pages to click on the link, if you make a link from page to page.
HTML link is done with the anchor tag <a> element and <a> element is then followed by an attribute(for hyperlink='href', for bookmark='name').

Syntax of HTML link

<a href="url"> text/image </a>

Href attribute for hyperlink in HTML.

Href attribute specifies the destination address, next comes the link text will send you to the specified address when you click on.
The link text can be an HTML image or other element, not only text.

Example:

HTML Editor

<html>
<body>
<a href="http://www.google.com"> Google </a>
</body>
</html>

Web Browser

How to link from page to page?

1. Supose, we want to make a link between index.html and about.html pages. first we open our index.html page and to do as below.

HTML Editor

<html>
<body>
<a href="about.html"> About Us </a>
</body>
</html>

Web Browser

2. After that you open your about.html page and to do as below.

HTML Editor

<html>
<body>
<a href="index.html"> Home Page </a>
</body>
</html>

Web Browser

  Now you create another page and try to create a link from index page to your created page for a good result about HTML link.


How to use an image as a link?

If you want to use images as a link you need to do is surround your image with <a href> </a> tag.
As like as below:
<a href="specified page.html"> <img src="specified image name"> </a>


Example:

HTML Editor

<html>
<body>
<a href="http://www.google.com"><img src="image/google.png"/></a>
<p> Image as a link </p>
</body>
</html>

Web Browser


Image as a link



More options for you.


General KnowledgeEnglish GrammarMathScienceIQ-TestQuiz-Test