Linking to a Web Page - HTML

The most popular link style on the Web is a link to another Web page or document. Such a link, when activated, causes the target page to load in the client browser. Control is then transferred to the target page—its scripts run, and so on. To link to another page on the Internet, you simply specify the target’s URL in the anchor tag. Suppose you want to link to the products page of the Acme Web site and the page is named products.html and resides in the products directory on the Acme Web server. The href parameter of the link:

Note that the URL contains the protocol, the server name, the directory name, and the filename. Figure shows a breakdown of the various pieces of the

The various pieces of a URL.

The various pieces of a URL.
In the case of this URL, the various pieces are separated by various key characters:

  • The protocol is first, and ends with a colon.
  • The server name is next, prefaced with a double slash.
  • The directory (or directories) is next, separated with slashes (/products/).
  • The filename of the page is last, separated from the directory by a slash (products.html).

Note: The server name is actually two pieces, the server’s name and the domain on which it resides. In the, www is the server name and is the domain.
There is a common misconception that all Web server names need to begin with www. Although www is a standard name for a Web server, the name can be almost anything.

All rights reserved © 2018 Wisdom IT Services India Pvt. Ltd Protection Status

HTML Topics