skip to Main Content

simple code is written.

<header>
    <div>
        <img src="../../images/bonjour_logo.png" alt="">
    </div>
</header>

I’m just trying to get this image into my header and I’m getting this error: Failed to load resource: the server responded with a status of 404 (Not Found)

I’m pretty sure my path is correct, but maybe I’m wrong.

enter image description here

2

Answers


  1. In order to load assets like images, fonts, etc.
    Use angular’s pre-generated assets folder, it can be found under src/assets

    You can move your image to src/assets/images/img.png and then use the image tag as given below.

    <img src="assets/images/img.png" alt="image text">
    

    It should work fine.

    Login or Signup to reply.
  2. You can put images folder into the folder when your html located and make src attribute like this src="images/bonjour_logo.png" if that doesn’t work your image corrupted or server is lagging

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search