Html inserting Images

This might be a dumb question but when following along in the lesson on how to insert an image on a html page the below was presented to access a file to insert. When I type this in the visual studio it does not access the files on my computer to insert it. Is there a setting or permission I have to change to allow visual studio to access files on my hard drive.

<img src="./ ?

1 Like

You have to link directly to your image file.
./ is stating the file is in the current directory level and the ? is a placeholder for the name of your file. Replace the ? with the name of your file.
for example, if your img file was ‘myPic.png’

<img src"./myPic.png alt="picture of myself"/>
1 Like

Exactly, the dot means the current folder where your html or css file is. You need to select the image relative to that folder. Make sure to keep the image inside your project folder.

2 Likes

Im having the same issue. When I type in ./ the wrong thing shows up in the drop down menu. How do I get to Assets from index.html?

Screenshot 2022-11-06 at 19.17.37

UPDATE: Ive found the answer online. Try these…
Screenshot 2022-11-06 at 19.28.35

Depends on which folder is your picture located, as the description of each file path example.

Maybe you can share an screenshot of your project so i can help you :nerd_face:

Carlos Z

1 Like

I did some online research and figured it out. Thank you though.

1 Like