HTML HTML Basics Going Further with HTML Links and Paths Challenge

Parminder Kaur
Parminder Kaur
3,219 Points

Set the "Portfolio" link to navigate to the section of the page with the id portfolio. <a href="/#portfolio"></a>.

It won't work

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">Portfolio</a></li>                
    </ul>
    <h1 id="portfolio">My Portfolio</h1>
  </body>
</html>

1 Answer

Steven Parker
Steven Parker
201,931 Points

For navigating to an ID within the same document, you only need the ID prefixed with "#" (no slash).
href="#portfolio"