Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

HTML HTML Links Websites: Part 2

John Cato
John Cato
2,565 Points

Websites: Part 2

Im having an issue connecting the two web pages together.

This is what I have for the first page for index.html

<a href="my_directory/another_page.html">My Link</a>

Here's the second page of code for another_page.html

<a href="index.html">Go Back</a>

I'm sorry if I'm not making too much sense. I'm not too good at explaining this via discussion board.

1 Answer

Nicholas Olsen
seal-mask
.a{fill-rule:evenodd;}techdegree
Nicholas Olsen
Front End Web Development Techdegree Student 19,342 Points

If your directory structure looks like this:

index.html
my_directory
    another_page.html

Then any links in another_page.html linking back to index.html need to refer to the parent directory. You can do that by using two periods like this:

<a href="../index.html">Go Back</a>

This means, "go back one directory and link to index.html"