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

Ryan Canty
PLUS
Ryan Canty
Courses Plus Student 5,665 Points

Set the <img> element's src attribute to a path that goes one level out of the current folder and inside a folder named

Cant really figure this one out.... any advice?

index.html
<!DOCTYPE html> 
<html>
  <head>
    <title>Portfolio Page</title>
  </head>
  <body>
    <img src=".../img" 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>

9 Answers

Hi Ryan,

You're on the right track but you only need 2 dots to go up one level from the current folder.

Also, you need to keep the filename that was there so it can still find the image file.

So you would need another forward slash after img and then the filename that was there when you started.

I got it. Thank You

Hi Shane,

Did you have the complete filename which was "logo.png"?

It's looking for a path like this "../img/logo.png"

That's saying to go up one level, then down into the "img" folder and then access the logo.png file that is in that img folder.

That doesn't seem to work either

Your earlier comment says you got it. Is everything ok now?

Yes I got it. Thank you

Abinet Kenore
Abinet Kenore
10,082 Points

<img src="../img/logo.png" alt="Site logo">

<img src=".../img" alt="Site logo">

Challenge Task 1 of 3

Set the <img> element's src attribute to a path that goes one level out of the current folder and inside a folder named img.

We'll done! Ary great...

<!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>

Challenge Task 3 of 3

Set the "Portfolio" link to navigate to the section of the page with the id portfolio.

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

it works : <img src="../img/logo.png" alt="Site logo">

Challenge Task 2 of 3

Set the "Home" link to a root-relative path that navigates to 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="">Portfolio</a></li>                
    </ul>
    <h1 id="portfolio">My Portfolio</h1>
  </body>
</html>
HIDAYATULLAH ARGHANDABI
HIDAYATULLAH ARGHANDABI
21,058 Points
<!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>

<!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>