Adding images to a public GitLab Page

I am building a plain HTML site using GitLab Pages and am trying to add a PNG image. The page is published as, but the image is not appearing.

  1. The PNG is in the folder: master/
  2. In the Index.html file I tried adding:

img src=“

but still no image appears on my GitLab Page.

This is probably a very common question, but I can’t find any documentation. Any answers / direction would be appreciated.

Problem solved! After multiple attempts to link the file correctly, this worked:

img src=“

Hope this helps someone else :slight_smile:

Hi @steve.greene,
The internal resources like images can be linked in a web page by relative URL or absolute URL.
absolute URL
relative URL /img/filename.png

I strongly suggest to use relative URL, in this way your website will not be bound to the base URL working in or localhost for example.

You can see an example here

1 Like