HTML img directory question

I am creating an HTML and CSS tutorial and I am trying to link an img element to a .png file, but I don’t know how to link an img element to a file in a different folder. Here is my project: Whoops, I forgot to debug | Replit I am trying to link an img element in intro.html to a png file in images. Does anybody know how to do this?

1 Like

It would be best if you did not put spaces in Image names, but you can set the src to /Images/{your image name}

Explanation

  • / denotes starting from root, so the home dir of your repl
  • ./ or no / denotes starting from here, so if you did hello/hello.png from intro/intro.html it would get the image from intro/hello/hello.png
  • …/ denotes one dir back, so home/intro/intro.html would go to home/hello/hello.png
2 Likes

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.