1 / 11

The Web Wizard’s Guide to HTML

The Web Wizard’s Guide to HTML. Chapter Four All About Hyperlinks. Chapter Objectives. Introduce three types of hyperlinks Explain how to add absolute URLs Explain how to add relative URLs Explain how to add named anchors Examine the problem of link maintenance.

Download Presentation

The Web Wizard’s Guide to HTML

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. The Web Wizard’s Guide to HTML Chapter Four All About Hyperlinks

  2. Chapter Objectives • Introduce three types of hyperlinks • Explain how to add absolute URLs • Explain how to add relative URLs • Explain how to add named anchors • Examine the problem of link maintenance

  3. Different Types of Hyperlinks • Absolute URLs point to Web pages on other Web servers • Relative URLs point to Web pages on the same Web server • Named Anchors point to a different location on the current Web page

  4. All Hyperlinks Have Two Parts • The Link Label is the visible element that the user points to and clicks (link labels can be text segments or images) • The Link Destination is the location that the link takes you to when you click on the link • Only the link destinations are handled differently for absolute URLs, relative URLs, and named anchors

  5. Anchor Tags • All hyperlinks are created with the anchor tag: <a>this is a link label</a> • The href attribute is used to specify the link destination: <a href=“destination.html”>

  6. Absolute URLs • All absolute URLs use complete URL addresses for their link destinations: <a href=“http://www.umass.edu/”>UMass-Amherst</a> • Any Web page can be referenced by an absolute URL as long as you have its correct address

  7. Relative URLs • A relative URL need only specify a file name for its link destination: <a href=“treehouse.html”>tree houses</a> • This assumes the destination file is in the same directory as the HTML file containing the link • If the file is in a different directory, pathing information must be added to the href value

  8. Named Anchors • A named link destination specifies a location that has been marked by an anchor tag with a name attribute <a href=“#lumber”>Some Good Lumber</a> <a name=“lumber”>some good lumber</a> • The href value is prefaced with the # character but the name value is not

  9. Named Anchors Combined with Other Links • A named anchor can be added to an absolute or relative link as long as the destination being referenced contains that named anchor <a href=“treehouse.html#lumber”>Some Good Lumber</a> • Just add a # followed by the anchor’s name to the end of the file name in the href value

  10. Link Maintenance • An absolute link that works today may not work tomorrow • Dead links frustrate visitors and detract from your Web pages • To keep all of your links operational, you have to test them periodically and update any that have died

  11. Automated Link Checkers • If you have a large number of links, you should automate the process of link testing • You can subscribe to a Web-based service for link testing and weekly or monthly link reports • You can obtain your own link testing software and run it yourself

More Related