Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

Development Tools

kendall strautman
kendall strautman
7,114 Points

Pushed to Github Pages - CSS and JS file paths not working

Hi!

I am trying to get a simple static project up on Github Pages and ran into an issue. I coded this project in Treehouse Workspaces and all worked fine. I downloaded the project files and pushed to github without any changes and now the style and JS file paths seem to be broken. I used relative file paths and I'm on Linux so no case sensitive issues. Any thoughts?

Here is the link to my repo - https://github.com/kendallstrautman/r.neil

Here is a snapshot of my treehouse workspace - https://w.trhou.se/l05jc171y9

kendall strautman
kendall strautman
7,114 Points

to follow up, I'm curious if it is the extra root ../ or if I even need ../ since I am currently in the main folder and just need to navigate down to styles/styles.css

2 Answers

Hey! No, I meant without going back a couple of directories since your index.html is at the root of the project. But you had already figured this out yourself, as you stated in your previous comment. Did it work?

kendall strautman
kendall strautman
7,114 Points

it did! I simply had to switch ../../styles/styles.css to styles/styles.css

Thanks for the help!

Hey!

Yes that would've been my guess as well. Why don't you try navigating to styles or scripts directly, see how it goes.

Good luck!

kendall strautman
kendall strautman
7,114 Points

Thanks! by navigating to them directly do you mean using an absolute path?