6.3 Relative URLs

As promised, in this section we provide additional details about relative URLs. A relative URL value allows you to jump to a web page that resides on the same web server as the current web page. It does so by specifying a path from the current directory to the destination web page. The current directory is the directory where the current web page resides. The destination web page is the page that the user jumps to after clicking on the link.

In forming a path for a relative URL value, you’ll need to understand how files and directories are organized in a directory tree structure. Note the example directory tree in FIGURE 6.2. It shows the container relationships between all the files and directories that are within the

Get Web Programming with HTML5, CSS, and JavaScript now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.