1

I hosted one of my project using GitHub pages but, for some reason, when I access the URL the page doesn't loads, and when I check it in the dev console it shows this error.

image of the error

This is my GitHub page URL: https://prasunk96.github.io/colorsgame/

I checked that all the internal links that I have in my html file are all correct.
I have tried it several times but it showing the same problem again and again.

VonC
  • 1,262,500
  • 529
  • 4,410
  • 5,250

2 Answers2

1

Github project pages can sometime take a bit before being updated. See "My GitHub page won't update its content" for a similar issue.

I do see (a few hours later) a 404 for your css:

github project page loaded
404

Try and see if using an anchored url works better:

<link rel="stylesheet" type="text/css" href="/css/colorGamepro.css">
                                            ^^^
                                             |
VonC
  • 1,262,500
  • 529
  • 4,410
  • 5,250
1

There are two issues with your CSS link:

  1. It is not relative to your html file so the browser is trying to go directly from the base prasunk96.github.io/ and not include the /colorsgame/.
  2. Github.io urls are case sensitive so your colorGamepro.css isn't being matched to the ColorGamepro.css file.

To correct the relative url you can either add a base tag to your HTML file or use a relative href. Once you correct the file name it should be able to find your file at https://prasunk96.github.io/colorsgame/css/ColorGamepro.css

In short use: href="./css/ColorGamepro.css"

Chic
  • 9,836
  • 4
  • 33
  • 62