Why is the path for my src attribute of the img tag missing?

I have tried every possible relative combination of paths I can think of and I still get a broken img icon on my page when I try to load it. The only thing that works is when I test the absolute path from the sample pic on the web.

The image I am trying to upload is in the same directory as the html page I want to upload to.

My file structure looks like this

                              src -> 
                                  pages -> 
                                         home-> 
                                                - home.html 

                                                - vectorstock_1623.jpg

      

Home.html

<img src="vectorstock_1623.jpg"/>

      

+3


source to share


1 answer


You need to put the image in a folder src/assets

. You can create a folder img

inside a folder assets

so that your image is placed in:

src/assets/img



and then in the view use this path:

<img src="assets/img/vectorstock_1623.jpg">

      

+2


source







All Articles