HTML HTML Basics Images, Text and Links Understanding File Paths

Understanding file paths Im lost

I lost. I click "read more". Page will not load?

4 Answers

Liam Clarke
MOD
Liam Clarke
Treehouse Moderator 19,245 Points

In this lesson, you are using relative URLs to move to different pages.

A relative URL is relative to where its current file is.

For example:

    root    |- assets       |- styles.css 
            |-
            |- includes     |- about.html
            |-
            |- index.html

On the above structure, in the index.html file, if want to reference the about.html, my anchor tag will look like this:

<a href="includes/about.html">About</a>

This is because relative to index.html I must go to the includes directory and then the about.html

in about.html if I want to reference the index.html page, my anchor tag will look like this:

<a href="../index.html">About</a>

There is only 1 file relative to about.html, in the includes directory so the two dots go back a directory and then I can reference the index.html file.

Hope this helps

Good Luck!

Thanks for your help.

My problem is, I think, is not being able to edit the mistakes in the root directory. Or the code is so badly mangled it gives me a code 80 fault.

Im not sure what to do at this point.

Liam Clarke
MOD
Liam Clarke
Treehouse Moderator 19,245 Points

When you click on the link, what is the full error you get in the console?