Web Pages in the same Directory

Classic programmed-learning exercises, refreshed for modern Java and presented in the current MrStyner.com portfolio style.

Modern Java noteThis archive has been refreshed for Java 25 LTS. Core language concepts remain useful, while outdated setup instructions and browser-era Java are labeled or replaced. Java 26 is the current feature release; Java 25 is used here as the stable teaching baseline.
go to previous page   go to home page   go to next page        

Answer:

Yes.

Web Pages in the same Directory

A full URL (Uniform Resource Locator) is needed when a page links to another one that is on a different computer. Often pages link to others that are in the same directory. In that case, using just the file name of the linked-to page will work:

<a href="PageB.html">Words that the user sees</A>

A Web browser shows the "Words that the user sees" underlined and in blue (depending on the preferences setting of the browser.) The user clicks on them to go to the linked-to page.

Hyperlinks can be placed practically anywhere in your Web page. The following shows a link that is part of a paragraph:


You can click   to see what the HTML does. But when you click on the link inside that window, it will probably not work (because it tries to link to a page on your hard disk that does not exist.)

QUESTION 8:

Play with the above Web page: Change the text of the anchor tag from "on this link" to some other words.

What is shown in the bar at the bottom of the browser window when you move the mouse pointer over a hyperlink such as the one below?