How to Code a Hyperlink

How to Code a Hyperlink thumbnail
Hyperlinks enable site visitors to access other Web pages with a click.

Hyperlinks are HTML codes that enable you to redirect site visitors to another site, or to a location within your site. You can also insert bookmarks or anchors into your Web pages. Hyperlinks are created with the HTML "<a>" element. Code your Web pages with hyperlinks to provide your site visitors with a helpful resource site, or to enable navigation within your site pages.

Instructions

    • 1

      Open your HTML document in a text or HTML editor.

    • 2

      Type the beginning "<a>" tag and include the "href" attribute with the URL of your destination page as a value. Type the text that you want the visitor to see and insert the ending "</a>" tag.

      <a href="http://www.google.com" target="_blank">Google</a>

      Use a target attribute of "_blank" to open the destination page in a new or blank window when redirecting your visitor to another site, so that your site will remain open as well.

    • 3

      Type the "name" attribute inside the "<a>" element to make a bookmark. For example, surround a document heading with "<a name="gotop">First Title</a>."

    • 4

      Type "<a href="gotop">Top</a>" to create a link that, when clicked, will take your user back to "gotop" position. This is useful for Web pages that scroll a long length.

Related Searches:

Resources

  • Photo Credit John Foxx/Stockbyte/Getty Images

Comments

Related Ads

Featured