HTML Links

Generally interface are make in all website page

HTML Links - Hyperlinks

HTML joins are hyperlinks.

A hyperlink is a content or a picture if snap and hop to another document.

HTML Links - Syntax

In HTML, joins are , depict with the <a> tag:

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


<a href="">Visit our HTML tutorial</a>
Try it Yourself »

The href quality indicates the goal address (

The link text is the noticeable part (Visit our HTML tutorial).

When the snap on connection, will send you to the predefined address.

Local Links

In This precedent is full web address

A nearby (connection to a similar site) is indicated with a relative URL (without http://www....).


<a href="html_images.html">HTML Images</a>
Try it Yourself »

HTML Links - Colors

When you move the mouse over a connection it will happens

  • The shade of the connection component will change

By default, a connection will show up in all programs, for example, Firefox Chrome

  • An unvisited connect is underlined and blue
  • A visited connect is underlined and purple
  • An dynamic connection is underlined and red

You can change the default hues, by utilizing styles:


a:link    {color:red; foundation color:transparent; content decoration:none}
a:visited {color:yellow; foundation color:transparent; content decoration:none}
a:hover   {color:red; foundation color:transparent; content decoration:underline}
a:active  {color:perpel; foundation color:transparent; content decoration:underline}
Try it Yourself »

HTML Links - The objective Attribute

The target ascribe determines where to open the connected document.

This model will open the connected record in another program window or in another tab:


<a href="" target="_blank">Visit welookups!</a>
Try it yourself »
Target Value Description
_blank Opens the connected report in another window or tab
_self Opens the connected report in indistinguishable edge from it was clicked (this is default)
_parent Opens the connected record in the parent frame
_top Opens the connected record in the full body of the window
framename Opens the connected record in a named frame

If your site page is secured a casing, you can utilize target="_top" to break out of the frame:


<a href="" target="_top">HTML5 tutorial!</a>
Try it Yourself »

HTML Links - Image as Link

It is regular to utilize pictures as links:


<a href="default.asp">
  <img src="smiley.gif" alt="HTML tutorial" style="width:42px;height:42px;border:0">
Try it Yourself »

HTML Links - Create a Bookmark

HTML bookmarks are utilized to enable perusers to hop to explicit pieces of a Web page.

Bookmarks are viable if your site has long pages.

To make a bookmark, you should initially make the bookmark, and after that include a connection to it.

When the connection is clicked, the page will look to the area with the bookmark.


First, make a bookmark with the id attribute:

<h2 id="tips">Useful Tips Section</h2>

Then, add a connection to the bookmark ("Useful Tips Section"), from inside the equivalent page:

<a href="#tips">Visit the Useful Tips Section</a>

Or, add a connection to the bookmark ("Useful Tips Section"), from another page:


<a href="html_tips.html#tips">Visit the Useful Tips Section</a>
Try it yourself »