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
176,605 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
176,605 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