Monday, May 18, 2015

How to Create a Link

Method 1 of 2: Creating a Basic Link

  1. Create a Link Step 1 Version 3.jpg

    Create the text or image you want to use as a link. Links are created using a simple HTML tag when editing the code of your website. First, however, you should create the content that will be placed inside the tag. This can be text, an image, or another HTML element, though the example used here is text.


  2. Create a Link Step 2 Version 3.jpg

    Surround the content you created with the tags. Hyperlinks are indicated using a simple tag, closed with the corresponding tag. These tags won't be functional if used without any attributes, but you can add those soon.
    • For example, your link might currently look like this: Click here to visit my new page.
  3. Create a Link Step 3 Version 3.jpg

    Add the "href" attribute to indicate the hyperlink destination. The "href" attribute tells the browser where to direct the user once the link is clicked. It is followed by an equals sign, which is followed by the destination web address in quotations.
    • Continuing with the example above, your link might now look like this: Click here to visit my new page.
    • Note that if the link's destination is an external website, you must include the entire URL (which likely begins with "http"). If only the page name is specified, as above, the directory of the current page will be used as the parent directory.
       Method 2 of 2: Adding Modifiers
  1. Create a Link Step 4 Version 3.jpg

    Create an image link. This is done by simply adding an image tag within the link tags. You will need the address of the hosted image, however (such as its location on your server or another server). Here is what an example image link might look like:
    • <a href="the_intended_link_url.html"><img src="the_picture_in_question.jpg" /></a>
  2. Create a Link Step 5 Version 3.jpg

    Create an email link using the "mailto:" modifier. To create a link which will begin composing an email message to a particular address, use the "mailto:" modifier just before the person's email address.
    • For example, an email link might look like this: Click here to ask a question or voice a concern.
  3. Create a Link Step 6 Version 2.jpg

    Create anchors within a large web page to be referenced later. If you need to link to a specific portion of a web page, you need to use an anchor. Anchors are useful in large pages with a table of contents; each section of the text can be assigned an anchor to which the table of contents can link. Anchors are created using the "name" attribute.
    • To create an anchor, insert the following tag at the appropriate location on the page: Chapter 3 - Using Anchors in HTML
    • To link to the anchor you created, use the # sign as follows: Skip to Chapter 3

0 comments: