0
I'm having trouble writing a path to fetch an image that exists in a different folder. I tried and it didn't work
31 Respostas
0
check the image format whether it is jpeg,jpeg or PNG copy your pic in the same directory of your HTML page then use the image tag as you do.or use adobe Dreamweaver to avoid these linking problems
+ 6
@Sami and @Jerry, if you want to insert an image, try to use <img> tag instead of <a> tag because its don't work. for the attribute, use src (acronym: source) instead of hreg (acronym: hyperlink reference).
hth, cmiiw
+ 5
try to write like this
<img src="../pictures/gym.jpeg">
+ 1
copy the image in the same folder where the file is saved
+ 1
@sami I got it! thank you! I was only Putting the file name and not the extension
+ 1
"./" means your current directory. so anything after " ./ " is from your current directory. now you want to access from different folder. lets consider this folder is outside your current directory. so all you need to do is use " ../" to go one folder up. to go two folder up use" ../../"
0
how did you tried??
and did you tried fetching image here in codeplayground??
0
no, on my pc
0
if your html file is in the same folder where your image file is then use
<a href="image.jpeg"></a>
but if it is in different folder such as:
folder: images/picture.jpg
index.html
then try using
<a href="../images/picture.jpg"></a>
0
I think that's what I did but let me try again row quick
0
The image I'm trying to link to is in my pictures folder on my PC. So I wrote <a href="/pictures/gym.jpeg">gym</a>
0
I am a beginner and I'm trying to learn how to instruct the browser to look outside the root folder for a file in a link
0
I don't want to insert an image I want to link to an image
0
Or hell any HTML file outside of the folder I'm just trying to get the hang of navigating outside of the folder with paths
0
I know I would use the Image Source element to insert an image on the page
0
@jerry did u managed to do it..??
0
no
0
I can't seem to link to an image file in another folder
0
u r missing href="../"
those dots
0
I guess it's not really necessary anyway I just keep all my Files in the same site folder