13

13Links

13.2

Internal links to a different page

This is virtually identical to the external link. It looks exactly the same on the web page:
section 1

If the mouse is hovered over the link, it looks like this:
section 1.

The HTML is the same too:

internal link to a different page html
<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: 
<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 anchor element and again it has the class hlink:

The only difference is the web address inside the href attribute, it doesn’t start with http; it just has the file name (and if the file were in a different directory, it would have the path name too, see § 7.3.6) of the target page.

If the http:// (or https://) is missing, the browser knows the link is referring to a page within the current website and will look for it in the current directory (or, if a path is supplied, in the directory pointed to by that path).

The class used is identical to that of an external link (listed in Code 13.2). Internal links to a different page are identical in appearance to an external link.

To use an internal link to a different page within the website, simply copy the HTML text above, the format is:

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

Insert the path/filename for the target page (if no path is entered, the browser will look for the file in the current directory). The visible text is the visible, clickable text that shows up on the web page.



End flourish image