Adding an img to vs code on linux

Hello Guys good day, i’ve been facing an issue on my laptop that has seriously affected my zeal to learn, i cannot seem to add sources from my pc.
for instance i have a file named download.png, i believe *<img src="download.png> should bring it out, or if it was in a folder named IMAGES then should bring me an image in my html code but it never works.
only sources from google with the href tag works, please help i was on windows and had to switch to linux thinking it would solve my problem but it never did.

In my vs code in a folder
i have my css separate, my html and my png, from tuts watched but it doesnt seem to work.

Show us your folder setup including where your index.html is as well as where your image folder is in relation.

I meant your folders in the file explorer.
(If you are on windows, pls list out the folders in detail view)

Also try “./google.png” instead in the src

i am currently on linux, also tried it, img still broken

Can you go to your directory where all your files are and write “ls -l *” without the quotes and provide the output (no screen shots pls)

I need to know the full path of your index.html and the full path of your image file.

If you can’t provide a ls output then at least provide this.

1 Like

Home/weirdo/Desktop/google.png

and where is your index.html?

Home/weirdo/Desktop/SCIMBA CSS/google.html

If you could please elucidate what you mean by index.html i would appreciate that

the HTML file that you are using (the one that has the <img src=" code you mentioned?

that is the path to the html file

okay so it seems that your image is 1 folder up
so try “…/google.png”
if that doesn’t work, try the full (absolute) path to your png (starting from “~/weirdo/Desktop/google.png”

1 Like

Thank you very much, i just moved all images to the index.html folder and sourced it, it worked!.

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