Why do I have to give the full address? img src ...

-2

I'm trying to make my first website.

At the moment I do not understand why, when inserting images I have to enter the full address, since in all blogs and HTML sites, this is not necessary. The image is in another folder. Someone help me?

The following works:

<img src="/home/rafa/Desktop/Curriculum Vitae/imagens/hall.jpg" alt="Foto inicial">

This no longer:

<img src="/imagens/hall.jpg" alt="Foto inicial"> 
    
asked by anonymous 29.06.2018 / 11:32

1 answer

0

If your HTML page is at the same level as the images folder, in this case inside the Curriculum Vitae folder, you will be able to access the image by src=imagens/hall.jpg or by src=./imagens/hall.jpg . The way you did, the browser is looking for the images folder in the /.

    
29.06.2018 / 20:06