Leakbali
w3 Tutorial, Web Tutorial
Switch to English Bahasa Indonesia 
Register   Login

HTML - Links


Links are found in nearly all Web pages. Links allow users to click their way from page to page.

A hyperlink (or link) is a word, group of words, or image that you can click on to jump to a new document or a new section within the current document.

When you move the cursor over a link in a Web page, the arrow will turn into a little hand.

Links are specified in HTML using the <a> tag.

The <a> tag can be used in two ways:
  1. To create a link to another document, by using the href attribute.
  2. To create a bookmark inside a document, by using the name attribute
The HTML code for a link is simple. It looks like this:
<a href="url">Link text</a>
The href attribute specifies the destination of a link.

Example:


<a href="http://www.leakbali.com/">Visit Leakbali.com</a>
which will display like this: Visit Leakbali.com

Clicking on this hyperlink will send the user to Leakbali.com homepage.

Tip: The "Link text" doesn't have to be text. You can link from an image or any other HTML element.
The target attribute specifies where to open the linked document.

The example below will open the linked document in a new browser window:
The name attribute specifies the name of an anchor.

The name attribute is used to create a bookmark inside an HTML document.

Bookmarks are not displayed in any special way. They are invisible to the reader.

Example:

A named anchor inside an HTML document:
<a name="tips">Useful Tips Section</a>
Create a link to the "Useful Tips Section" inside the same document:
<a href="#tips">Visit the Useful Tips Section</a>
Or, create a link to the "Useful Tips Section" from another page:
<a href="http://www.leakbali.com/html_links.htm#tips"> Visit the Useful Tips Section</a>
Note: Always add a trailing slash to subfolder references. If you link like this: href="http://www.leakbali.com/html", you will generate two requests to the server, the server will first add a slash to the address, and then create a new request like this: href="http://www.leakbali.com/html/".

Tip: Named anchors are often used to create "table of contents" at the beginning of a large document. Each chapter within the document is given a named anchor, and links to each of these anchors are put at the top of the document.

Tip: If a browser does not find the named anchor specified, it goes to the top of the document. No error occurs.

References

About Us

Home
About Us
Contact Us
Sitemap

Tools

Google PageRank
Alexa Rank
Keywords Density

Accounts

Register Account
Login
Valid XHTML 1.0 TransitionalValid CSS!
Web Directory


2006 - 2012 © Leakbali.com - Free Web Tutorial, Free Web Articles, Web Sharing, Source Codes, Web References