Welcome to the Treehouse Community

The Treehouse Community is a meeting place for developers, designers, and programmers of all backgrounds and skill levels to get support. Collaborate here on code errors or bugs that you need feedback on, or asking for an extra set of eyes on your latest project. Join thousands of Treehouse students and alumni in the community today. (Note: Only Treehouse students can comment or ask questions, but non-students are welcome to browse our conversations.)

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and a supportive community. Start your free trial today.

HTML HTML Basics Going Further with HTML Links and Paths Challenge

I do not have a way of saving the other files. Can anyone assist me with how to open files on this exercise?

https://teamtreehouse.com/library/html-basics-2/going-further-with-html/links-and-paths-challenge

index.html
<!DOCTYPE html> 
<html>
  <head>
    <title>Portfolio Page</title>
  </head>
  <body>
    <img src=../img.png></img>
     <ul>
      <li><a href="">Home</a></li>
      <li><a href="">Portfolio</a></li>                
    </ul>
    <h1 id="portfolio">My Portfolio</h1>
  </body>
</html>
Brendan Whiting
seal-mask
.a{fill-rule:evenodd;}techdegree seal-36
Brendan Whiting
Front End Web Development Techdegree Graduate 84,696 Points

Which files do you want to open?

This challenge wants you do change the src and href attributes of a some elements to point to files. But you don't need to view these other files in order to do this work, you just need to code the right references to them. If the instructions aren't clear what those references should be let me know.

I think they went over my head. I did see where there was (src=..) is suppose to bring up the next file. I do not know how to open up that file on the practice to actually perform or execute this and complete it. Do you have any suggestions? I'm going to go back and review the whole section.

2 Answers

Brendan Whiting
seal-mask
.a{fill-rule:evenodd;}techdegree seal-36
Brendan Whiting
Front End Web Development Techdegree Graduate 84,696 Points

In Challenge Task 1 of 3 they give us this instruction: "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."

This is what the img element looks like now:

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

So right now this is going to show an img element, and the source of that img element is at this path: "logo.png". This means they're pointing to a file "logo.png" that lives in the same folder as the index.html file we're looking at right now.

But the challenge is saying that image isn't actually there. So if this page was rendered, it might not show the right image. They want us to look one folder above the current folder, in another folder called "img". So we need to change the path to reflect this: : "../img/logo.png". The "../" here means one folder up. So the new img element would look like this:

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

We can't actually look at the folder structure of these files. We just have to take their word for it that these files and folders are how they say they are.

Thank you so much sir, that was a Great help!