• Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint
Share this Page URL

Kinds of Links

Before you start putting links on your Web pages, you should be aware of the different kinds of pathnames you can use to link to another document on the Internet (Figure 6.3). There are four different kinds of links you can use:

  • Absolute pathnames (http://www.tarin.com/BayArea/baynav.html) point, in most instances, to a location on the Internet outside the site where the current page is located. In the pathname http://www.tarin.com/BayArea/baynav.html, the document baynav.html is located within the BayArea/ directory, which is within the root site www.tarin.com/.

  • Document-relative pathnames ( home.html, ./baynav.html) point from the current page to another document within the same site, using dots and slashes to tell the browser when it needs to look in another directory to find the page. You can link from one document to another without using the full URL, and Dreamweaver will keep track of what those dots and slashes mean—and it can also make sure your links are correct when you update your site by renaming or moving your pages, as long as you make those changes in Dreamweaver's Files panel. See the section Moving Files in Chapter 2 for instructions on how to move files and folders around and have Dreamweaver automatically update all links that point to those files.

    A Basic Link

    The HTML code for a link looks like this:

    <A HREF="file.html">linked text</A>

    The A stands for anchor, the original name for links. HREF means Hypertext Reference.

  • Site-root-relative pathnames (/baynav.html) also point from the current document to another document that's within the same site. Instead of using dots and slashes to indicate moving from folder to folder, the Web browser starts at the home or root directory and looks for the page from there. If you're constructing a large site in which pages might be moved around outside of Dreamweaver, site-root relative links will still be correct even if the page is moved.

  • Named anchors link to a point within a page; either from point to point on a single page, or from one page to a specific location on another page. See Linking to a Section of a Page, later in this chapter.



Not a subscriber?

Start A Free Trial

  • Creative Edge
  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint