My projects images not showing in github host

Viewed 24
3 Answers

Here is the fix,

index.html > Line 47 > <img src="Images/profile.jpg" alt="">

style.css > Line 11 > background-image: url(https://i.ibb.co/TKvQgnK/hero.jpg);


In the style.css > line 11 > I hosted your image and added a link in the style.css file. Otherwise, I suggest you move the images folder into the style folder and link that into the CSS and HTML file.

I added the solution to your GitHub issue also. :)

Here is the link for more info: https://www.delftstack.com/howto/css/background-image-not-showing-css/

I just inspected the path of your images and I found that you do it like this. src="/Images/profile.jpg" when you should do it like this: src="./Images/profile.jpg"

Why?

because file location matters.

<img src="picture.jpg">     The "picture.jpg" file is located in the same folder as the current page
<img src="images/picture.jpg">  The "picture.jpg" file is located in the images folder in the current folder
<img src="/images/picture.jpg">     The "picture.jpg" file is located in the images folder at the root of the current web
<img src="../picture.jpg">  The "picture.jpg" file is located in the folder one level up from the current folder
Related