Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

HTML HTML Basics Going Further with HTML Links and Paths Challenge

Alain Dwight
seal-mask
.a{fill-rule:evenodd;}techdegree seal-36
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
231,248 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
231,248 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
seal-mask
.a{fill-rule:evenodd;}techdegree seal-36
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
231,248 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.