HTML HTML Basics Going Further with HTML Links and Paths Challenge

Alain Dwight
Alain Dwight
Front End Web Development Techdegree Graduate 21,669 Points

correct index link is <a href="/index.html"> yet <a href="/index.html#portfolio"> does not link to <h1 id="portfolio">?

Am I wrong or is the challenge malfunctioning?

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

1 Answer

Steven Parker
Steven Parker
160,328 Points

The instructions say, "Set the "Portfolio" link to navigate to the section of the page with the id portfolio."

And "the page" it is referring to is the current page, not the index page that the other link goes to.

Steven Parker
Steven Parker
160,328 Points

Well, we don't know it's the one at root level, but you have a good point! You might want to submit a bug report to the Support folks about that.

Alain Dwight
Alain Dwight
Front End Web Development Techdegree Graduate 21,669 Points

Couldn't hurt, although that last hole you poked in my reasoning could well frame the question as including a test of general reasoning (indeed, I stumbled and now have learned - and I've studied plenty of logic).

Still, not sure if that was the intended or ideal scope of the question!

Steven Parker
Steven Parker
160,328 Points

I tested it, and a relative reference does not pass the validation either. But while it should work, it would involve a page reload where the accepted solution does not. So it might help clarify the task to add something like "... on the current page without reloading." to the instructions.