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

David Collins
PLUS
David Collins
Courses Plus Student 2,598 Points

How do I create a directory file or folder

I'm using notepad++ and the area that I'm studying in it is called "Websites part 1 and 2". I have no problem linking these to websites together, my problem is how to make a directory file, so I can create another link . Now the first web page it is called (My Page) the link address is. file:///C:/Users/David/Desktop/index.html Okay now the second web page it is called (another page) the link address is. file:///C:/Users/David/Desktop/another_page.html I tried several different ways to create this directory file and it did not work. Now my operating system is windows 7 also I'm using Google Chrome to do this
I need someone to explain to me how to create this directory file so I can finish this course

If I'm understanding you correctly, both HTML files exist on the desktop. What I don't understand is the relationship between a "directory file" and creating another link. Can you possibly clarify what your goal is?

3 Answers

You say: "I have tried several different ways to create this file called my directory..." I think you're actually trying to create a folder, not a file. The two files you mention must be placed within the folder called "my_directory". Since you're on Windows, you'll have to right-click somewhere on your desktop, click "new", and select "folder." Once this folder is created, appropriately re-named, and once both HTML files are placed within this folder, you must also update the link paths in both HTML files (following the example given by Nick Pettit). Let me know if this works. I hope I've understood your problem correctly. :)

David Collins
PLUS
David Collins
Courses Plus Student 2,598 Points

Hello James Cool This is the first web page that was created

<!DOCTYPE html>
<html lang="en">
<head>
   <meta charset="utf-8">
   <title>My Page</title>
</head>
<body>
    <p>Our first page</p>
       <a href="another_page.html">My Link</a>

</body>
</html>   

Now this is the second one

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="utf-8">
     <title>Another Page</title>
</head>
<body>
     <p>Another page</p>
        <a href="index.html">Go Back</a>

   </body>
</html> 

Okay, now these two are linked together because they're in the same folder which is my desktop. Nick Pettit the teacher this is what he said " Inside of our Links folder here, we'll go ahead and create another folder. And I'm just going to call this "my_directory." And I'm going to move "another_page.html" into "my_directory." So now, when we switch back to the browser, Refresh the page, and click on the link in "index.html" we'll get: "This webpage is not found" or something similar, depending on which browser you're using. That's what's called a broken link." This is how he links these two back together is like this

<a href="my_directory/another_page.html">My Link</a>

The whole subject is about is about this. Difference between relative and absolute links. These two types of links allow us to link files together in various ways. I have tried several different ways to create this file called my directory, I have tried putting it on my desktop, in my document but all I get errors. I hope that I make this easier to understand Thank you for your time and helping me in this matter its really appreciated Thank you

David Collins
PLUS
David Collins
Courses Plus Student 2,598 Points

Hey James Cool I've have worked on this for a couple days now, usually I can get it but its not happening. What I think it boils down to is he's on a Mac I'm on a PC his has a different text editor then I do or I'm just a dumb donkey, I have a couple ex wives that would agree with that Have a good day!! Thank you for your help I appreciate it David