Links in HTML:

In any web site a link is a reference to another page. A Web site is a collection of many pages so most of the times “link” will be used to connect these pages with each other. In HTML links are also known as hyperlink. A hyperlink can be anything like text, an image, a element, a email address etc. A hyperlink allows user to go from one page to another page.

In HTML <a> opening tag and </a> closing tag are used to define a link. To access link you have to click on that link. By default links are viewed in blue color with underline. You can change it by applying style to it. The pointer is also changed when you bring the cursor on it.

Syntax:

<a href=”url”>text for link</a>

The “href” attribute in <a> tag is necessary because it defines the destination address of link.

Example:

The Target Attribute in Link:

You can also specify in <a> tag that where the linked document get open means the document will open in new tab or open in new window etc. For that “target” attribute is used.

Example:

In above example the document will get open in new window or new tab.

In HTML there are four type of targets they are as follow:

_blank :- It will opens a linked document in new window or tab.

_self :- It will opens a linked document in same window (by default).

_paraent :- It will opens a linked document in paraent frame.

_top :- It will opens a linked document in the full body of window.

Image as a Link:

You can also use an image as a link. But be sure that the image is valid and give the accurate path on image tag.

Example:

Note:

This example will not work on your PC so use an image which is available on your PC.

Email as a Link:

You can also link an email. So that any one can direct mail you by clicking on that email.

Example:

Note:

In above example “%20” is used to add space between text.

3 responses to “Links in HTML”

  1. Wendell Ronzoni says:

    Hey very cool PHP site!! Man .. Excellent .. Amazing .. I will bookmark your blog and take the feeds also…I’m happy to find numerous useful info here in the post, we need work out more strategies in this regard, thanks for sharing. . . . . ….

  2. Thaddeus Heckman says:

    Thank you ever so for you blog post.Really looking forward to read more. Really Cool.

  3. Vijay Patel says:

    Hey! I could have sworn I’ve been to this site before but after reading through some of the post I
    realized it’s new to me. Anyhow, I’m definitely glad I found it and I’ll
    be bookmarking and checking back frequently!

Leave a Reply

Your email address will not be published. Required fields are marked *