Latest web development tutorials

HTML links

HTML use of hyperlinks connected with another document on the network. Almost you can find links to all the pages. Click on the links to jump from one page to another page.


Try - Example

HTML links
How to create a link in an HTML document.

(You can find more examples at the bottom of this page)

HTML hyperlinks (links)

HTML uses tags <a> to set hypertext links.

Hyperlinks can be a word, a word, or a group of words, it can be an image, you can click on these to jump to a new document or a section of the current document.

When you move the mouse pointer to a link on a Web page, the arrow changes to a small hand.

Use the href attribute <a> tag to describe the link address.

By default, the link will appear in the form of a browser:

  • A unvisited link displayed in blue font and underlined.
  • Visited links are purple and underlined.
  • Click on the link, the link is displayed in red and underlined.

NOTE: If you set the CSS style for these hyperlinks, according to CSS style show the setting display.

HTML Link Syntax

Link HTML code is very simple. It is like this ::

<ahref=" url ">link text</a>

href attribute describes the target of the link. .


<a href=""> visit this tutorial </a>

The above line of code appear as :: visit this tutorial

Click on the hyperlink takes the user to the tutorial page.

Tip:"Link text"does not have to be text.Images or other HTML element can be a link.

HTML Links - target property

Use the target attribute, you can define the linked document is displayed where.

The line below will open the document in a new window:


<A href = "" target = "_blank"> visit this tutorial! </ a>

try it"

HTML connection - id attribute

id attribute can be used to create an HTML document bookmarked.

Tip: Bookmarks are not displayed in any special way, in the HTML document is not displayed, so the reader is hidden.


ID is inserted in an HTML document:

<a id="tips"> Helpful Hints section </a>

Create a link to the "Useful Tips section (id =" tips ")" in the HTML document:

<a href="#tips"> access helpful hints section </a>

Or, create a link from another page to the "Useful Tips section (id =" tips ")":

<a href="">
Access Useful Tips section </a>

Basic precautions - Useful Tips

Note: Always add a forward slash to subfolder.If so writing link: href = "", will produce twice HTTP request to the server. This is because the server will add a slash to the address, and then create a new request like this: href = "".


More examples

Picture Link
How to use image links.

In the current page link to the specified location
How to use bookmarks

Outside the box
This example demonstrates how to jump out of the frame, if your page is secured within the framework.

Create e-mail link
How This example demonstrates how to link a message. (In this case to work after you install the mail client.)

Built Email Link 2
This example demonstrates a more complex e-mail link.

HTML link tag

label description
<a> Define a hyperlink