I can do the “add images” exercise here at codecademy just fine. But when I try to do the same thing in a .html file in TextEdit on my Mac, it doesn’t work. I’ve tried multiple things:
I made sure that the image was in the same folder as the TextEdit .html file. Didn’t work.
I wrote the complete file path to the image. Didn’t work.
I tried making the letters uppercase or lowercase. Didn’t work.
I tried using single quotes instead of double quotes. Didn’t work.
Finally I tried just copying a random weblink picture, and that didn’t work either.
I am able to drag the image onto the browser and have it display, so I know the image is not corrupted.
What am I doing wrong? The other text and paragraphs display just fine. But the images display as a blue question mark in a small box.
@stetim94
yes I copy and paste the image name so that it matches. I’ve tried with a few different images, none of them working.
I’m not sure why my quotation marks look odd. I just tried going to preferences and unchecking the “use smart quotes” but it still changes them when I type in a TextEdit document. My settings are plain text, so not sure why this happens.
this problems are so difficult to trouble shoot from here. Upload a image of the directory with files + path and an updated version of your code with markup:
All the pictures and the html file are in the exact same folder. The path will be the same for all of them. So, do I even need to put the path in the file, or just the filename with extension?
@stetim94 Problem solved. You were correct. It was the quotation marks. The solution was going to system preferences, unchecking “smart quotes,” and then rebooting the system. Now the pictures will display.
which starts with /, and relative path (starts at the directory which contains the html file:
imagename.jpg
you can also use directory’s inside the directory which contains the html file. And .. for previous directory. Just google relative file path, sure you will find it