CS396: Spring 2022

Intro to Web Development

CS396: Spring 2022

HTML Resources > 3. Hyperlinks

Login to LinkedIn Learning via Northwestern

Overview Resources

1. Navigating Relative File Paths

Given the image below, the following relative paths are from the perspective of the index.html file.

../test.html # go up one directory and access the test.html file
../files/blah.html # go up one directory and then into the files directory, and access the blah.html file
../images/dogs/a1.png # go up one directory, then into the images directory, then into the dogs directory, and access the a1.png image
styles/my_style.css # go into the styles directory and access the my_style.css file
styles/dark/new.css # go into the styles directory, then into the dark directory, and access the new.css file

Download the sample files to experiment with relative file paths (and view the home/index.html).

2. Linking to pages within your own site

3. Linking to external pages

Additional Resources

4. Linking to page regions

Additional Resources

The links in this example don’t link to anything (yet), but is meant to show that div and span tags can be useful for grouping links into conceptual widgets (like menus)