Home > other >  HTML: Images not loading on VSC
HTML: Images not loading on VSC

Time:04-21

I have made a script using HTML code that involves images. These images work and display when using live server on VSC and I can also open the file when clicking and holding the COMMAND button - <img src="thumbnails/thumbnail-1.webp">

However when I copy and paste the code on another script, the image file cannot be found nor does the image display.

I cannot figure out why it doesn't work as it works perfectly on the first script but not others. The file directory for the images are the same and the script is also HTML type. All code is the exact same as the working script, but still doesn't work on new scripts

CodePudding user response:

Check again your folder name and file name Or try this <img src="/thumbnails/thumbnail-1.webp">

CodePudding user response:

You will have to use “alt=“ property under image tag . Your code will be like—-

<img src="thumbnails/thumbnail-1.webp" alt="html image">

  • Related