GitHub Pages not working correctly

Hello folks.
Do You use GitHub pages to host your work?
I’m new to GitHub and I need help, because the content on CodePen and the content on GitHub pages is different.
How do I avoid it?

Here are the example links:

gh pages:

You probably will understand yourself if you open the browser console on the hosted github page and review the errors, but the links to the your style.css and your script.js file in index.html are wrong.

Why are they wrong?
It works also offline when i open it as html file

you have this line on your index.html (on gh-pages branch of the repo):
<link rel="stylesheet" href="css/style.css">

this indicates that your stylesheet is located on the css folder with the name style.css while there’s no css folder and the stylesheet is placed in the root folder (on the gh-pages branch). the same goes for the js file. you should fix this.

1 Like

note that it doesn’t matter what you place on the master branch of your repo. Only the files that are on the gh-pages branch will be loaded for the website.

1 Like

Thank you very much!!! I couldn’t figure out whats wrong for like one hour lol

1 Like