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 How to Make a Website Adding Pages to a Website Add a New Page

Alex Thomas
Alex Thomas
4,247 Points

file tree error

For some reason my two html files won't link together. Neither of them are in css folder nor img folder. The two html files are main.html and index.html. When i preview workspace for index.html, it shows up fine in the browser. So, I commented out the entire page of code for index.html and previewed main.html, nothing shows up. For some reason i'm thinking that this is a file tree issue. What am I doing wrong here?

1 Answer

Steven Parker
Steven Parker
231,236 Points

Your entire index.html file is commented out.

So by default, your preview page is totally blank. But if I remove the comment markers, it still has a few issues:

  • the body is inside the head, but it should come after
  • the link to main.html comes before the body, but all rendered elements should be inside the body
  • the link has no contents to make it visible
    <a href="main.html"></a>  <!-- note empty link will be invisible! -->

Then if I go to the main page, I do not see the image that should be the link. You forgot to specify the folder where the image is located:

      <a href="index.html"><img src="img/bmw.jpg"></a>  <!-- notice "img/" added -->
Alex Thomas
Alex Thomas
4,247 Points

Im not sure what the problem was, or rather, it was a file tree issue, somehow one of the html pages wouldn't render anything. That's why I commented out one of the html docs, to test the other one. It wouldn't render any text in the browser at all. I ended up copy/paste all code to brand new workspace and every thing works as it should now. Thanks a lot Steven. I appreciated it.