ERR_ABORTED 404 error

My site is running well on Live Server while opened in VSC, but when I published it on GitHub Pages it runs without CSS files. When I opened an inspector I found this ERR_ABORTED 404 error in Console:

Screenshot 2021-12-29 at 21.02.31

This is the reason why my CSS file does not work on GitHub Pages. But it works well on Live Server. What should I do?

1 Like

You’re using an absolute path for the CSS file:

That breaks because your page isn’t at the root of the server. Change it to a relative URL (without the leading /) so it works as long as the relative position of your HTML and CSS files is the same.


Thanks! That helped!

1 Like