Help with img src file not loading up. Mac OS ( thanks in advance)

I am not so sure where the mistake is. I opened my image on safari copied the link and used it on my image tag. I am using VS code to wire and display my code.

 <img src="file:///Users/erickgarcia/Desktop/Images/hacksaw.jp
g">

A good first rule, generally speaking, is to not use file: network protocol. Use shortened http: protocol. Store the objects relative to the HTML pages, either in the same folder, or in a subfolder from them, or in a sibling folder one level up. Then use relative addressing to access the files. This way your file(s) are portable and easy to mount online when the time comes.

site_root/
  + images/
    - hacksaw.jpg
  - index.html
<img src="images/hacksaw.jpg" alt="hacksaw">
site_root/
  + images/
    - hacksaw.jpg
  + pages/
    - index.html
<img src="../images/hacksaw.jpg" alt="hacksaw">
1 Like

Thanks so much. This method works I will remember to use this from now on.

1 Like