1

I've tried to upload my custom CSS file to apply to https://soundoffmusic.com/

I've got the raw CSS file with this file path

https://raw.githubusercontent.com/themomoravi/SoundOff-Website/master/styles.css

and I've tried using this as my href since it points directly to the raw CSS file:

href="https://raw.githubusercontent.com/themomoravi/SoundOff-Website/master/styles.css">

Still it has not worked. I've also tried the abbreviated versions of this such as styles.css, SoundOff-Website/styles.css, etc. (as my href). I'm wondering why else github pages might not be rendering my custom CSS.

Please advise and thanks so much in advance.

Ralf
  • 16,086
  • 4
  • 44
  • 68

1 Answers1

1

If you are serving your website from a GitHub repository using GitHub pages (which I assume you are doing, judging by the raw link you provided), you can (and should) reference your assets in a relative way, such as

   <link rel="stylesheet" href="./styles.css">

in your index.html's <head>.

Linking directly to GitHub raw storage can cause problems as it is not designed as a CDN and everything is always returned with a plain/text header. There used to be a service that provided a solid bridge between a client and raw GH storage, but it's been shut down and GitHub pages work just as well now.

mkrl
  • 740
  • 6
  • 20