<img> not working

24 AM

Hi @anshgames,

Your image will only load when you give it a correct path of where the image file is located (the source).

If you have an online image, say the pic (or image) above:

The img src should be written with the path:

<img src="https://codecademy-discourse.s3.amazonaws.com/original/5X/d/4/b/2/d4b292d5feca32169938b3931b4480408f137ffb.png"

If you’re testing from your local environment without connecting to internet and your image is located in your local folder (saved somewhere in your computer), you should get the path towards where the image is located, you could get the full path address by right clicking it, open with any browsers, copy the address and put it in the src

or there’s another way, grouping the image with the HTML file into a folder, and reference the path accordingly, which requires deeper understanding of what is explained here:

Basically, your img tag

<img src="web.png" />

will only work if the image is in the same directory with the HTML file.

For tag img you should use link of image to paste it to code in CodeAcademy. In general, you can use such code as you show, but image and your html document must be in the same folder or place

Thank you for your information

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