Share this Page URL

Chapter 6. Working with Links > More About Relative Links - Pg. 232

Working with Links 232 the file is, which it doesn't have to do when the links are relative. Three, if you keep a copy of your Web site in more than one location or if you relocate it to a different domain or server, you want the links to be correct whether the visitor is looking at your page on or, and with relative links, you don't need to re-code each page. More About Relative Links Everyone knows that a Web address looks like this: On the other hand, if you're linking to pages within the same site, you don't need to include the entire, absolute URL in your link. If you use a relative link, the browser will look for the page within the same site. Then, your link might look like this in the code: page.html or /page.html Which is which? The first example is a document-relative link from one page to another page in the same folder (Figure 6.4). You can also use document-relative links to link pages in different folders together.