Adding Hyperlinks

http://www.w3schools.com/html/html_intro.asp

Hyperlinks, or links for short, are the heart and soul of Web pages. Links enable users to navigate from one topic to the next and from one page to another. The user simply clicks the link and the browser immediately opens the designated page. Links can be text or images. Most commonly, links appear as underlined text on a page. However, images, also make good links. When a user hovers his or her mouse pointer over a link, the pointer takes the shape of a pointing hand, indicating the presence of an active link.


Link to Other Web Sites Link to Other Pages on Your Site Linking to Other Areas on the Same Web Page
You can use links on your Web page to direct users to other pages on the Internet. For example, you might include a link on your company Web page to a local city directory detailing available activities and hotels in the area. Or you might add a link on a product page to the manufacturer’s Web site If your Web site consist of more than one page, you can include links to other pages on the site. For example, your main page may provide links to pages about your business, products, and ordering information, and a map of your location. If your Web page is particularly long, you can provide links to different areas on the same page. For example, you might include links to each topic heading or photo on the page. This allows the user to jump right to the information he or she wants to view.

Absolute and Relative Links.

You can use two types of links in your HTML documents: absolute and relative. Absolute links use a complete URL to point to specific page on the Web. Relative links use shorthand to reference a page. You generally use relative links to reference documents on the same Web site.

Absolute Link: HTML Getting Started at w3schools.com

Relative Link: How to Plan Building your Web Site?

Relative Link: Adding Sounds and Videos


Steps in adding and formatting hyperlinks in your HTML document:

  1. Insert a Link to Another Page
  2. Insert a Link to a New Window
  3. Insert a Link to an Area on the Same Page
  4. Link to an E-Mail Address

1. Insert a Link to Another Page

You can create a link on your HTML document that, when clicked, takes the visitor to another page on the Web. You can link to a page on your own Web site, to a page elsewhere on the Web. In order to create a link, you must know the URL of the page to which you want to link, such as http://www.kp.org. The syntax to insert a link is <A HREF="?"> where ? is the URL of the page to which you want to link. You will need to end the link text with </A>

2. Insert a Link to a New Window

You can add instructions to an HTML link that tell the browser to open the link page in a new browser window. You may add this instruction if you want to keep a window to your own site open so the user can easily return to your page. You use a TARGET attribute within the link anchor element <A> to open links in new windows. By assigning the TARGET the value _blank, it instructs the browser to keep you page open while opening a new unnamed window for the URL. To make all links on your page open in a new windows you can use the BASE element.

3.Insert a Link to an Area on the Same Page

The key to linking on the same page is assigning names to the various areas to which you want to link. You can do this with the NAME attribute. Keep your naming system simple, using only letters and numbers to name the sections throughout your document.You can add links to your page that, when clicked, take the user to another area on the same page. This is particularly useful for longer documents. For example, you can add links that take the user to different headings throughout your document. The syntax to select the area to link the section on the page is <A NAME="?"> where ? is the unique name for the area. The syntax to create the link to the area is <A HREF="#?"> where ? is the unique name of the section to which you want to link. At the end, close the link text with </A>

4. Link to an E-Mail Address

You can add a link to your Web page that allows users to send you an e-mail message. Adding e-mail links is good way to solicit feedback from your Web site visitors, as well as enable them to ask questions about you or your site. The syntax to link a text to an email address is <A HREF="mailto:?"> where ? is the email address you want to use. At the end, close the link tag with </A>

Go to Top