HTML Links - Hyperlinks


links are hyperlinks.

You can click on a link and jump to another document.

When you move the mouse over a link, the mouse arrow will turn into a little hand.


HTML Links - Syntax


In HTML, links are defined with the <a> tag:

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

Example

<a href="http://www.jarwar4you.blogspot.com">Visit our  tutorial</a>

The href attribute specifies the destination address (http://www.jarwar4you.blogspot.com) of the link.
The link text is the visible part (Visit our HTML tutorial).

Clicking on the link text will send you to the specified address.


Local Links

The example above used an absolute URL (A full web address).

A local link (link to the same web site) is specified with a relative URL (without http://www....).

Example

<a href="html_images.asp">HTML Images</a>


HTML Link Colors


By default, a link will appear like this (in all browsers):

  • An unvisited link is underlined and blue
  • A visited link is underlined and purple
  • An active link is underlined and red


You can change the default colors, by using styles:

<style>

a:link    {color:green; background-color:transparent; text-decoration:none}

a:visited {color:pink; background-color:transparent; text-decoration:none}

a:hover   {color:red; background-color:transparent; text-decoration:underline}

a:active  {color:yellow; background-color:transparent; text-decoration:underline}

</style>

HTML Links - Image as Link

It is common to use images as links:


<a href="default.asp">

  <img src="smiley.gif" alt="HTML tutorial" style="width:42px;height:42px;border:0;">

</a>

External Paths


External pages can be referenced with a full URL or with a path relative to the current web page.
This example uses a full URL to link to a web page:

<a href="http://www.jarwar4you.blogspot.com/html/default.html">HTML tutorial</a>


If You Like This Post Plz Comments
Thank You





Related Posts