Images are broken
I uploaded the whole files to my github repository and redownloaded it to see if its working. when I open the .html, almost all images are looks broken even tho images are in the file. I've checked the path destiny and it is true.
But when I host it as a live server from VSCODE it got fixed, I can see all of the images pretty good. What is the problem?
24 Replies
this probably has to do with paths local/vs host
show us devtools what it looks like on github (img src="") and what your folder stucture looks like?
Okay 1 minute
best if you just share the repo/hosted
but that will get us closer π
syre
sure*
GitHub
GitHub - realchugunov/Website
Contribute to realchugunov/Website development by creating an account on GitHub.
For example Agriculture image
ah yup !
so
/
is a root path
its looking for those images on github pages in the root which your github pages address is something like https://user.github.io/folder
where folder is your home dir
./
is a relative to its folderYes
so either remove the starting
/
or use ./
you will see other things you loading probably work cause you are using a relative path (without /)these probably work
Okay let me try
would not load
I'll try this right now
Yes now it is fixed
I've tried with .
Thank you
welcome! just make sure you understand the why, its really important going forward π
paths/urls is something that some how gets missed in learning web dev idk how...
and its like most important (routing, deps, files, etc.)
../
is up a dirIβve always known that as back a dir π
I mean guess that is all in how you view a path/tree
Thatβs true yeah
either straight line (back) or in a tree (up)
I'm not pedantic about that stuff... call it what ever lets you remember how it works π