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

I think I am having issues with my workspaces can someone help me

When I preview my Workspaces it not previewing right

After the code that I put in and save it and then preview it. Then the some reason the file name is showing. click on that and everything shows up.

This is my workspaces that I am working on right now

<!DOCTYPE html>
<html>
  <head>
     <meta> charset="utf-8">
     <title>Doug Rouse    Programmer </title>
  </head>
  <body>
    <header>
      <a href="index.html">
         <h1>Doug Rouse</h1>
         <h2>Programmer</h2> 
      </a>
      <nav>
         <ul>
           <li><a href="index.html"></a>Portfolio</li>
           <li><a href="about.html"></a>About</li>
           <li><a href="contact.html"></a>Contact</li>
        </ul>
      </nav>
    </header>
    <section>
       <ul>
        <li>
          <a href="img/numbers-01.jpg"></a>
           <img src="img/numbers-01.jpg" alt="">
            <p>Drips created using Photoshop brushes.</p>
          </a>
        </li>
    <li>
          <a href="img/numbers-02.jpg"></a>
           <img src="img/numbers-02.jpg" alt="">
            <p>Eperimentation with color and texture.</p>
          </a>
        </li>
    <li>
          <a href="img/numbers-06.jpg"></a>
           <img src="img/numbers-06.jpg" alt="">
            <p>Playing with blending modesin Photoshop.</p>
          </a>
        </li>
    <li>
          <a href="img/numbers-09.jpg"></a>
           <img src="img/numbers-09.jpg" alt="">
            <p>Trying ti create an 80's style of glows.</p>
          </a>
        </li>
    <li>
          <a href="img/numbers-12.jpg"></a>
           <img src="img/numbers-12.jpg" alt="">
            <pCreating shapes using Photoshop brushes.</p>
          </a>
        </li>

      </ul>
    </section>
    <footer>
      <p>&copy; 2017 Doug Rouse.</p>
    </footer>
  </body>  
</html>

Edited for readability by Dane E. Parchment Jr. (Moderator)

Dane Parchment
Dane Parchment
Treehouse Moderator 11,077 Points

What exactly isn't previewing correctly? Is there an error in the code that you are previewing, or are you receiving an actual error when you try to preview?

Dane Parchment
Dane Parchment
Treehouse Moderator 11,077 Points

Can you please show me your directory structure? I am pretty sure that your issues lies there. Your code is not wrong, instead the way you structured your project is not the way that you want it to work (Not exactly wrong, but will not give you the result you need). So please show me your project structure.

I.E

Main Workspace Folder
|-----index.html
|-----about.html
|-----contact.html
|-----css
|---------main.css

Of course I am not assuming that your project structure is like the one above, but if you read the answer I gave earlier you can see what I think the issue is, and how to fix it.

P.S : Please respond with a comment, instead of an answer. (use the add comment button to respond accordingly)

Dane Parchment
Dane Parchment
Treehouse Moderator 11,077 Points

Doug, I want you to take a screenshot of your workspace, upload it to imgur and then link it here. I want to see your directory structure to determine if this is an error on your end or if Workspaces is messing up. Honestly I am pretty sure the issue is your directory structure and if you send me that image I can solve your problem.

Note that I deleted most of the posts here, please respond by using the add comment button, so that we can stop filling up your question with non-answers!

8 Answers

Dane Parchment
MOD
Dane Parchment
Treehouse Moderator 11,077 Points

Ok, so I believe I know what your problem is, and truth be told it is not really a bug or issue, it is just the nature of html code.

Possible Issue 1 - Your folder structure

If you folder structure looks like this

|-Main Workspace Directory
|---------Child Folder
|------------file within child folder.html

Then the issue is that when you call preview, the server will return the directory of the workspace because there is no index.html that it can see, to alleviate this issue create an index.html file within your main workspace directory like so:

|-Main Workspace Directory
|--------index.html
|--------Child Folder
|---------------file within child folder.html

Possible Issue 2 - No index.html

If your directory structure is like this

|-Main Workspace Directory
|--------random name.html

Then when you preview, the server is expecting to find an index.html but because it doesn't it returns the directory instead. To fix this problem also create an index.html file, or rename your html file to index.html.


Remember that a webserver is always looking to display an index.html page by default, if it cannot find that file, it will instead show the directory of the file that you are trying to view. So in both cases you must create an index.html file or instead rename your html file to index.html.

Ok I did that

I found it

It was showing two index.html at the top of workspaces. Now in the left side pane I'm showing 2 Index.html files which one to get to delete and HTML folder do I keep or do I delete it

Dane Parchment
Dane Parchment
Treehouse Moderator 11,077 Points

Ok if I understand you correctly your project structure looks like this:

Main Workspace Folder
|-----index.html
|-----index.html
|-----HTML
|---- ... (other folders and files)

If so, delete the HTML folder, it isn't necessary remove whichever index.html file that doesn't have code you want in it, if both have the same code, then just delete whichever one you want.

Ok that worked now what

How can I show you my Preview page

How do I send you a snap shot of my workspaces

Dane Parchment
Dane Parchment
Treehouse Moderator 11,077 Points

If you are on windows hold the windows key (to the left of left-alt) and then press the prt sc key, that will take a screenshot of you screen, then go to imgur, and upload the image there, it should be free, then you can copy paste the link here.

Dane Parchment
Dane Parchment
Treehouse Moderator 11,077 Points

Ok, I messed up with you, apparently you can share a snapshot from within workspaces itself (haven't really used workspaces myself, so i apologize for making you go through the extra work). However, to take a snapshot all you need to do is click that suitcase icon on the top right of your screen and then once selected click the take snapshot button, then you can just copy paste the link in here, and i can see your entire workspace.

Dane Parchment
Dane Parchment
Treehouse Moderator 11,077 Points

Here is a step by step of how to share a link:

  1. Go to your workspaces: https://cl.ly/2k1m081n3q1O
  2. Then click the snaptshot button: https://cl.ly/3s1W0O0q2h3k
  3. Then click the take snapshot button: https://cl.ly/0P3D221e1Z35
  4. Go to the link created: https://cl.ly/163f1H0l3I0e

  5. That URL is the link to your snapshot

http://w.trhou.se/k7ct2mah01 I have to going out to pick up my wife car be back shortly