13

13Links

13.2

Internal links to a different page

This is vir­tu­ally iden­ti­cal to the ex­ter­nal link. It looks ex­actly the same on the web page:
section 1

If the mouse is hov­ered over the link, it looks like this:
section 1.

The HTML is the same too:

internal link to a different page html
  1. <p class="hyp">Linking to another page within the website will open that page with the top of the page displayed in the browser. Such a link has the following appearance:
  2. <a class="hlink" href="01-00-introduction.html">Section 1</a>.</p>
Code 13.3   Internal link to a different page typical HTML

Again the link is in the an­chor el­e­ment and again it has the class hlink:

The only dif­fer­ence is the web ad­dress in­side the href at­tribute, it doesn’t start with http; it just has the file name (and if the file were in a dif­fer­ent di­rec­tory, it would have the path name too, see § 7.3.6) of the tar­get page.

If the http:// (or https://) is miss­ing, the browser knows the link is re­fer­ring to a page within the cur­rent web­site and will look for it in the cur­rent di­rec­tory (or, if a path is sup­plied, in the di­rec­tory pointed to by that path).

The class used is iden­ti­cal to that of an ex­ter­nal link (listed in Code 13.2). In­ter­nal links to a dif­fer­ent page are iden­ti­cal in ap­pear­ance to an ex­ter­nal link.

To use an in­ter­nal link to a dif­fer­ent page within the web­site, sim­ply copy the HTML text above, the for­mat is:

<a class="hlink" href="PATH/FILENAME">VISIBLE TEXT</a>

In­sert the path/file­name for the tar­get page (if no path is en­tered, the browser will look for the file in the cur­rent di­rec­tory). The vis­i­ble text is the vis­i­ble, click­able text that shows up on the web page.



End flourish image