ANSWERS: 1
  • One of the most basic and essential pieces of a website is the link. Links allow us to navigate from one page to another, upload and download, view content and more. A link consists of the destination, or what happens when a user clicks on a link; the label, or what the user clicks on to activate the link, such as text or an image; and the target, or where the destination is displayed, such as a new window or tab.

    Linking to Other Pages

    To add a link to a Web page, open your HTML document and type <a href="URL.html">. URL.html is the address of the page you are linking to. A link can be either absolute or relative. A relative link is a link within the same directory as the page you are linking from. In this case, the address only needs to include the path to the page, not the entire URL. For example, to link from your own home page to the "About Us" page, you might type only "about.html" for the URL, as long as that page is in the same directory as "index.html." For an absolute link, you must type the complete address of the page, including the http:// protocol, like this: "http://www.someothersite.com". In summary, you should generally use relative URLs for other pages on your own website and absolute URLs for anything else. Next, type the link text (label), or what the user sees and clicks on, and close the tag by typing </a>.

    Linking to Anchors

    Linking to anchors means linking to a different spot on the same page or a specific spot on another page. For example, you may want to direct a user not only to a different page but to a specific section on that page. To create an anchor link, you must first create the anchor itself. Type <a name="anchor name">. The anchor name is simply how you will identify that section. The section you want to reference should be placed next, followed by the closing tag </a>. This is the anchor. To create the link to that anchor, type <a href="#anchor name">. "Anchor name" is the name you designated in the anchor tag itself. Type the link text next, followed by </a>.

    Using Images as Links

    Image links are created the same way as text links, except you use an image for the label, instead of text. Type the opening link tag <a href="URL.html">, and then add the image <img src="image.jpg"/>. "image.jpg" is the location of the image. Then close the link </a>.

    Source:

    "HTML for the World Wide Web;" Elizabeth Castro; 2003

    • Wenso
      Useful article..thanks for sharing the post..

Copyright 2023, Wired Ivy, LLC

Answerbag | Terms of Service | Privacy Policy