10.07.2017 Views

246996016-HTML5-Step-by-Step

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

Hyperlinking to a Web Page 69<br />

The opening page of the US version of the Microsoft Web site opens. Now type this URL<br />

instead:<br />

http://www.microsoft.com/en/us/default.aspx<br />

The same page loads. The first time, when you omitted the file name, the Web server<br />

responded <strong>by</strong> sending the default file, which is named default.aspx.<br />

Note The URL in this example points to a page named default.aspx. ASP stands for Active<br />

Server Pages, which is an advanced technology used for commercial Web development. Pages<br />

created with ASP typically have .asp or .aspx extensions. For your own pages, you should<br />

continue to use the .htm extension.<br />

If you want to link to a specific page, you must specify the complete file name. For<br />

example, if you wanted to provide a direct link to the page where users can download<br />

Windows Media Player, you would use this tag:<br />

<br />

Download Windows Media Player<br />

Using Relative and Absolute Paths<br />

Paths that contain a complete address that anyone can use to get to that page are called<br />

absolute paths. Absolute paths are very reliable, but they are also long and awkward to<br />

type. For example:<br />

Diagnosing Foliage<br />

Problems<br />

When you are linking to files in the same Web site as the link itself, you do not need to<br />

include the complete path to the file; you can simply provide its name. When the file<br />

is in the same folder, you need only supply the file name. For example, if the index.htm<br />

and foliage.htm pages of The Garden Company Web site were in the same folder, in the<br />

index.htm file, you could refer to foliage.htm like this:<br />

Diagnosing Foliage Problems<br />

This is called a relative path, because the destination file is relative to the current file’s<br />

location. Relative paths make it easier to develop and test your Web site in a different<br />

file location than the one where it will eventually be stored. For example, in this book,<br />

you’ll be doing most of your development in the Documents\Microsoft Press\<strong>HTML5</strong> SBS<br />

folder, which would typically not be the final destination for a site you are developing. By<br />

making as many relative references as possible, you avoid the need to re-code every URL<br />

when your site is moved to its final destination.

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!