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

Help! Index.html and styles.css not linking on GitHub!

Sorry if this is an easy fix (I hope it is!) But I am new to GitHub! I made a web page using index.html for the html, styles.css for my CSS and there's a couple of images downloaded onto my laptop from photos. All are stored within the same folder and I used VS coder. The page loads fine from my local drive on my local computer. I made a new repository on GitHub and drag/dropped my files across. However the images and CSS are not loading onto the browser. Just the html file. In VS Coder the path is link href="/user/my name/directory/file/styles.css". I've tried changing it around to just styles.css or copying the GitHub path? Or removing or adding  am the / . What am I doing wrong?

1 Reply
Highlighted
Pilot Lvl 2
Message 2 of 2

Re: Help! Index.html and styles.css not linking on GitHub!

I would try removing the / from the href, as this usually fixes the issue associated with directories. If this doesn't work, also try adding a . before the /. Here are a couple example fixes:

 

Example Fix 1

href="user/my name/directory/file/styles.css"

Example Fix 2

href="./user/my name/directory/file/styles.css"

Hope this fixes your problem!

 

Gavin R. Isgar - Freelance Software Developer