skip to Main Content

I am trying to make a picture show on my GitHub website, but it isn’t showing up.

It only shows this:

enter image description here

Here is the relevant code:

<img src="C:UsersamundDownloadsAmund5.png" alt="Amund5"src="Amund5.png" width="500" height="400">

I tried changing the script but it didn’t work

2

Answers



  1. Your img src refers to a path on your local machine. So while amund5.png is at c:UsersamundDownloads on your machine, that’s not where Github is going to find it.

    You’ll need to commit the image to your repository, then reference its location relative to the repository. You can also use a fully-qualified URL, like <img src="https://my.site/some-path/Amund5.png">

    Login or Signup to reply.
  2. Loading from local resources is not allowed. There are a few workarounds for this:

    1. Upload the image to the repository itself and index it from there
    <img src="./Amund5.png" alt="Amund5" />
    
    <!-- file structure -->
    ├── Amund5.png
    ├── index.html
    
    1. Upload the image to some online service like Google Photos or Imagur and use the image link in the img tag
    <img src="https://example.com/imgs/Amund5.png" alt="Amund5" />
    
    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search