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 Build a Simple Website Text Editors and HTML Images and Lists

won't let me save index.html

says "can't save /index.html"

15 Answers

Matt Trask
Matt Trask
10,027 Points

dont have a "slash" in front of it. just save the file as index.html in your projects folder. what operating system are you on?

I tried to eliminate the slash, but it kept coming up. I am on Mac OS X version 10.7.5

Jordan Clarke
Jordan Clarke
23,464 Points

No need for the forward slash at the beginning. Just save as index.html in whatever folder you're using for the website.

Jordan Clarke
Jordan Clarke
23,464 Points

Hi Margot. Have you created a new folder on the desktop and tried saving to there?

um no... what kind of folder should it be. On the video it has a "web" folder which I don't have. Should I do it like that?

Jordan Clarke
Jordan Clarke
23,464 Points

Just create a standard new folder on your desktop and call it 'web project' or whatever you want and try saving the index.html there.

Can you please give us more context? Why are you trying to save a file? Who's asking you to do it? Thanks!

I am trying to do the step in the lists and images section (around second 56 in the 12:55 long video) of saving sublime text 2 as index.html.

Ok I just did it! Thank you all for your help. One thing though, I tried to download an image myself and use it in the code of this demonstration, but when I refreshed the browser, it didn't pick it up. Not a big deal, but if anyone feels like telling me why that would be great.

Jordan Clarke
Jordan Clarke
23,464 Points

No problem. On that next point, you'd need to post the code so we can see what might be causing the issue.

ok, first I created a folder called img, then I downloaded an image from the internet, saved it as cupcake.jpg and put it in the folder. This is the code I used: <img src="img/cupcake.jpg" alt="Smells Like Bakin">

Paul Dariye
PLUS
Paul Dariye
Courses Plus Student 9,097 Points

Hey try this in your terminal. cd into the directory you're using for your project and then type the following:

$ sudo chmod 777 .

I hope this works. a shorter way is to have the path to the directory directly without having to cd into it so it would be:

$ sudo chmod 777 /path/to/your/directory/

After either of these, try saving your file again.

Let me know how it goes.

Jordan Clarke
Jordan Clarke
23,464 Points

I cant see the code for some reason Margot. You're correct to create a IMG folder and put the image in here. The code to insert the image should look something like this:

<img src="img/cupcake.jpg" alt="cupcake">

Jordan Clarke
Jordan Clarke
23,464 Points

````<img src="img/cupcake.jpg" alt="cupcake">

Jordan Clarke
Jordan Clarke
23,464 Points
    <img src="img/cupcake.jpg" alt="cupcake">

yes that is exactly what i wrote. maybe i created the folder incorrectly? I just created a new folder and called it img.

Jordan Clarke
Jordan Clarke
23,464 Points

No you need to create a folder on desktop, call it 'web project', then in that folder create another folder called 'img' and put the image in there. You want a main folder for the files such as the index.html and then a secondary folder inside the main one to place your images in.

That Worked!!! Thank you!

Jordan Clarke
Jordan Clarke
23,464 Points

No problem. Happy to help :-)

Thank you so much Jordan, I will try that