CSS is not being applied to my html pages #22832
-
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/ 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: 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. |
Beta Was this translation helpful? Give feedback.
Replies: 12 comments
-
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 To prevent this in future you can either:
|
Beta Was this translation helpful? Give feedback.
-
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. |
Beta Was this translation helpful? Give feedback.
-
I’m still facing same issues as well how may I come out of the challenge please |
Beta Was this translation helpful? Give feedback.
-
CC is not being applied to my html page |
Beta Was this translation helpful? Give feedback.
-
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.
paulbizsunny:
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. |
Beta Was this translation helpful? Give feedback.
-
No I’m satisfied, I don’t have new topic you know I’m newly for the field I’m still learning thank you |
Beta Was this translation helpful? Give feedback.
-
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. Pet Clinic |
Beta Was this translation helpful? Give feedback.
-
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? |
Beta Was this translation helpful? Give feedback.
-
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. |
Beta Was this translation helpful? Give feedback.
-
It’s working now. |
Beta Was this translation helpful? Give feedback.
-
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:
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, |
Beta Was this translation helpful? Give feedback.
-
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. |
Beta Was this translation helpful? Give feedback.
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:
_config.yml
file