How To

How to Define an Anchor in HTML

Contributor
By eHow Contributing Writer
(0 Ratings)

Anchors are used to create links to other documents, the essential activity of the World Wide Web. They can also be used to define bookmarks within the current document, so that other hyperlinks can link to them.

Difficulty: Moderately Easy
Instructions

Things You'll Need:

  • HTML or text file editor

    Define the Anchor in HTML

  1. Step 1

    Begin by opening your HTML editing software program and placing your cursor at the exact location where you want to define the anchor on your web page.

  2. Step 2

    Type the following:
    Click here to visit my website

  3. Step 3

    Replace the material between quotes with the URL of the web page you want to link to.

  4. Step 4

    Change the "Click here to visit my website" line with the text that you want to appear marked as a hyperlink. In most cases, the hyperlink will be blue and underlined.

  5. Step 5

    Leave the tag the way it is if you want the hyperlinked document to appear in the same window. However, should you want it to appear in a new window, add a target attribute so that the final result would look like this:
    Click here to visit my website

Tips & Warnings
  • The document that your anchor hyperlinks to will open in the same browser window as the current web page.
  • Don't forget to close your anchor tag, or all your subsequent text will take on the attributes of the anchor.

Comments  

teniente said

Flag This Comment

on 3/12/2008 This is what I want to do.

I know about how anchors go from page to page. I, also, know how anchors go to certain sections in the same page.

But what I want to know is how a link will go to another page and to a named anchor in that page. In other words I don't want it to open up to the top of the page but in the middle where I have an anchor at.

Can you tell how to do that?

Post a Comment

Post a Comment

Have you done this? Click here to let us know.

I Did This

Related Ads

Internet
Virginia DeBolt,

Meet Virginia DeBolt eHow’s Internet Expert.

Copyright © 1999-2009 eHow, Inc. Use of this web site constitutes acceptance of the eHow Terms of Use and Privacy Policy.   en-US

Demand Media
eHow_eHow Technology and Electronics