HTML: Images not loading on VSC

498 views Asked by At

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 class="thumbnail" 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

2

There are 2 answers

2
sabdahtb On

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

0
Germanjeet Singh On

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

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