HTML HTML Basics Going Further with HTML Links and Paths Challenge

Abz Man
Abz Man
1,351 Points

Rootpaths: I tried numerous combinations but i just don't understand it now?

Please help

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

1 Answer

Steven Parker
Steven Parker
167,908 Points

The instructions say "Set the "Home" link to a root-relative path that navigates to index.html.", but there's no mention of a specific tag ID to target.

Also, it may work without an explicit name, but it would be better not to assume which file name the server will use as a default.

Abz Man
Abz Man
1,351 Points

Can you show me how to do this please as i cannot comprehend.

Steven Parker
Steven Parker
167,908 Points

Setting the link means filling in the "href" property value, and "root relative" basically means "start with a slash", and then you add the file name:

      <li><a href="/index.html">Home</a></li>