CSS is not being applied to my html pages

I have recently just finished coding my portfolio on Brackets (I’m not sure what version, I believe it is the most recent one). I have three folders in my repository and they are not linking to my HTML files.

Here is the link to my site: https://morisettea.github.io/portfolio/
Here is my repository: https://github.com/MorisetteA/portfolio

Everything works when I use the live preview on brackets and as well as clicking the file to display on a browser.

My pathway in my git repository and my computer is:
_css (folder)
_fonts(folder)
_images(folder)
index.html
About.html
(as well as a couple of more HTML files)

This is how I called my files.

I’m not sure if I have my settings wrong in my git repository or something case-sensitive I am not aware of? Any help would be greatly appreciated, this is my first time doing this!

EDIT: I fixed it!!! so what the problem was is that I named my folders with an “_” like “_css” and that was the problem. Not sure why this would be an issue, I’ll have to research that.

1 Like

Glad you fixed it already! To give you some more info, and to leave some for anyone in the future that finds this, GitHub Pages uses Jekyll to build sites by default. Jekyll excludes files and directories that start with certain special characters like _ unless you explicitly include them inside your _config.yml file. You can see a list of them here:

https://docs.github.com/en/github/working-with-github-pages/about-github-pages-and-jekyll#configuring-jekyll-in-your-github-pages-site

To prevent this in future you can either:

  • Rename the file or directory
  • Explicitly include the file/directory in the _config.yml file
  • Disable Jekyll altogether if you’re not using it by creating an empty file called .nojekyll in the root of your Pages publishing source
1 Like

Thank you so much for the response and the prevention tips!!! Your explanation really helped, I had not idea about Jekyll excluding filed with special characters.

I’m still facing same issues as well how may I come out of the challenge please

CC is not being applied to my html page

Hi @paulbizsunny We are happy you are here! You are more likely to get a useful response if you are explicit about what your project entails, giving a few more details might help someone give you a nudge in the right directions.

If your issue is different from the user’s issue and solution above in this topic, we encourage you to open a new topic with the detail of your source code or public repository that you would like help with.

No I’m satisfied, I don’t have new topic you know I’m newly for the field I’m still learning thank you

Hi, Could you please assist me with with similar issue? The css wasn’t applied to my page, I changed few things it worked but not correctly.

Hi @Ericnk1, welcome to the GitHub Support Community!

I’m seeing CSS being applied to that page correctly. Did you manage to figure this out or are you still having issues somewhere?

1 Like

Hi, when I use Edge, the css is well applied just like on my localhost. But with Chrome not very well. Also the Script file, JQuery, and other files from the node_modules folder can’t be accessed even though I added the node_modules in there.

Thank you very much for your assistance.

It’s working now.
Thank you very much!

Hello folks, good day!

I’m not having CSS rendered for the pages under this particular URL - https://divya-mohan0209.github.io/docusaurus-current-theme/rucio/

The CSS, however, along with the imaging is being rendered perfectly for pages one level up - https://divya-mohan0209.github.io/docusaurus-current-theme/

A bit more about my project:

  • I am using Sphinx to convert Python RST files into HTML
  • The HTML files are built into the rucio directory and are published on to GH-pages using docusaurus.

Docusaurus is being used since we anticipate the requirement of MDX support.

I’ve included a .nojekyll file per the suggestions here in the rucio directory, since I’m aware Jekyll excludes stuff after _ in a file.

Since I do not have much control the files generated by sphinx/Docusaurus, i.e. _static, _css etc. could you please suggest if I’m going wrong somewhere?

Regards,
Divya

Just to add on, it’s being rendered seamlessly on my local machine so I genuinely believe it has something to do with the jekyll bit.