Welcome to the Treehouse Community

The Treehouse Community is a meeting place for developers, designers, and programmers of all backgrounds and skill levels to get support. Collaborate here on code errors or bugs that you need feedback on, or asking for an extra set of eyes on your latest project. Join thousands of Treehouse students and alumni in the community today. (Note: Only Treehouse students can comment or ask questions, but non-students are welcome to browse our conversations.)

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and a supportive community. Start your free trial today.

HTML HTML Basics Going Further with HTML Links and Paths Challenge

Finley Williamson
Finley Williamson
11,375 Points

I somehow cannot create this root-relative link back to index.html My code: <li><a href="\">Home</a></li>

I very much feel like this is right already??

It seems very simple and I cannot figure out what I am doing wrong.

index.html
<!DOCTYPE html> 
<html>
  <head>
    <title>Portfolio Page</title>
  </head>
  <body>
    <img src="../img/logo.png" alt="Site logo">
    <ul>
      <li><a href="\">Home</a></li>
      <li><a href="">Portfolio</a></li>                
    </ul>
    <h1 id="portfolio">My Portfolio</h1>
  </body>
</html>

1 Answer

Steven Parker
Steven Parker
221,938 Points

The folder separator character is not backslash (\), but slash (/ - you got it right already in task 1).

Also, while a simple slash will do the job, it relies on the server configuration to deliver the correct file. For "best practice", you should include the file name after the slash.

Finley Williamson
Finley Williamson
11,375 Points

Wow this is a little strange still.. Only because they say "root-relative." In the exercises immediately preceding this question, root relative paths relied on "\", but I put in a "/" and it worked immediately.

Thanks for the help I'll be thinking about this as I move forward!

Steven Parker
Steven Parker
221,938 Points

Take another look, I'm pretty sure slash is used consistently throughout the video on Root-relative Paths. There's a particularly good example of 4 root-relative links at about time index 2:10.

Finley Williamson
Finley Williamson
11,375 Points

... I did too many modules yesterday @___@ I went back and looked, I had confused everything. You are correct my friend. Thank you x2