Help
cancel
Showing results for 
Search instead for 
Did you mean: 
Copilot Lvl 2
Message 1 of 4

Broken images

Solved! Go to Solution.

Hi Guys,

 

It is first time here and I need immediate help.

 

I am a newbie coder and I have just recently completed my portfolio. When I first deployed my portfolio on github pages everything worked well and images for my project section were showing but during my last commit the images are now showing as broken. I am using VS code and when I launch the live server the images are showing fine. 

 

here is a snippet:

 

image on the right is viewing the projects page with live server and the left is thru gitbhub pages.

image not working.jpg

 

 

If you must check my code to check the problem. here is the repo: https://github.com/eatcodesforlife/portfolio 

3 Replies
Highlighted
Solution
Pilot Lvl 1
Message 2 of 4

Re: Broken images

Hi @eatcodesforlife,

 

It looks like the issue is the two dots plus the slash "../"at the beginning of your images' src attributes. This is basically a reference to a folder up one directory from /portfolio/ -- it refers to the root of your github pages (https://eatcodesforlife.github.io/) in this case. Since projects.html is in the same directory as /img, you can refer to it like this :

 

src="img/flexbox.jpg"

 

 

 I'm not sure what the result would be on your live server, but you can open the devtools and hover the src to see where it's getting the images from, like in the example above, if there's any issues on your end.

Copilot Lvl 2
Message 3 of 4

Re: Broken images

Hey @SethClydesdale,

 

That worked! Thanks a mil!

Ground Controller Lvl 1
Message 4 of 4

Re: Broken images

Capture.PNGCapture1.PNG

i had tried adding ../  but its look nothing have changed

 

 

link :-  https://iweyouclasses.github.io/core/topics/String.html