Web pages can contain links that take you directly to other pages and even specific parts of a given page. These links are known as hyperlinks.
Hyperlinks allow visitors to navigate between Web sites by clicking on words, phrases, and images.
It can point to any resource on the Web: An HTML page, an image, a sound file, a movie, etc.
*openging <a> and closeing </a> tag.
The syntax of creating an anchor:
<a href="url"> Text to be displayed </a>
Target :-The target attribute is used to specify where the linked document will be opened.
To open a linked document in a new window, use the attribute
target="_blank"
1. _top:
The user agent should load the document into the full, original window (thus canceling all other frames). This value is equivalent to _self if the current frame has no parent.
2. _parent:
The user agent should load the document into the immediate FRAMESET parent of the current frame. This value is equivalent to _self if the current frame has no parent.
3. _blank:
The user agent (i.e. Internet browser) should load the designated document in a new, unnamed window.
4. _self:
The user agent should load the document in the same frame as the element that refers to this target. By default its "_self".
When you move the mouse cursor over a link, two things will normally happen:
An unvisited link is underlined and blue
To set colors of the links, active links and visited links can be done using link , alink and vlink attributes of <body> tag.
<html> <head> <title> Welcome to HTML Tutroial </title> </head> <body alink="red" vlink="blue" link="green"> <a href="http://www.acadnote.com">Acadnote</a> </body> </html>
Acadnote
It is common to use images as links:
<a href="html_links.php">
<img src="html.png" alt="HTML tutorial" style="width:42px;height:42px;border:0">
</a>
<a href="url#label">content</a>
<html> <head> <title> Welcome to HTML Tutroial </title> </head> <body> <a href="html_links.php#lsswp">HTML Links</a> </body> </html>
<html> <head> <title> Welcome to HTML Tutroial </title> </head> <body> <a name="lsswp">HTML Links</a> <h1> Learn More and Enjoy More </h1> </body> </html>
Links - Image as Link
Or, create a link to the <a> element from another page:
<a href="www.fastlearning.in/html_links.php#down">Visit</a>