CSS doesn't work accordingly. Only partly works.

Hi guys, 

I have a simple website where the CSS doesn’t fully work. Its only apply partly. 

The pasted folder full path and the published version on Github look slightly different. The published one looks bit messy while the pasted folder full path looks neat. 


Please let me know if anyone can help. Thank you. 

Hi, @fideliaholy

In the time since you posted your question, it looks like you’ve been able to get your CSS stylesheet working. Nice work!

Nevertheless, I took a look at the commit history of your repository, and thought I’d share some observations that might help to explain how to avoid the trouble you faced earlier.

GitHub Pages is case-sensitive. This means that GitHub Pages considers a folder named “CSS” distinct from a folder named “css”. This is typical behaviour for web servers, but generally not the case for personal computers running Windows and macOS. As a result, you might find your site loads as expected when opening it on your local machine, but appears broken when deployed with GitHub Pages.

As an example, if your HTML file contains a reference to “css/styles.css”, but your stylesheet is actually located at “CSS/styles.css”, GitHub Pages will fail to locate the stylesheet. To avoid such troubles, I’d recommend adopting consistently lowercase names for your files and directories.

I hope that helps to explain!


1 Like