Css doesn't load

Hello there everyone my CSS doesn’t load I saved it a path above under a folder called: “.css” in my code of the index.html I added: <link rel="stylesheet" href=".css/index.css"> I tried to force reload it with cleared cache without clearing cache I tried it on my local PC and it worked without any problems I tried to add a / before it and without it I added …/…/ without any results so I didn’t know anything else to do so might as well search an answer here

Thanks in advance

In general a relative link will be better, because it should work both locally and in Pages. Exactly what is going on would require a look at your repository structure.

Things to look at:

  • Was your attempt at relative paths correct? To refer to the parent directory use ../, not .../.
  • Is capitalization correct? When people work on Windows the file system usually ignores it, but on the web it must be correct.

I tried …/…/ and …/…/ (2 dots) Yes capitalization is correct and I am an kali user not Windows

Edit: I just noticed github keeps on adding by the two dots another dot so I added: (2 dots)

.../.../ will not work. “Parent directory” is two dots, not three. What else might be going wrong is impossible to say without a look at your repository, you’d need to share a link for that.

Edit: Because I just noticed github made my first reply from two dots into three I will just say in the future: (2 Dots)

I kept it simple for testing and already a simple line of code doesn’t work that great on github XD

I see two issues there:

  1. The path to the CSS file is wrong. The index.html file currently includes ../../.css/index.css, when from the directory layout it needs to be .css/index.css (because the .css folder is next to index.html).

  2. The .css directory doesn’t make it to the deployed site. This is because of how Jekyll treats the Directory Structure:

Every file or directory beginning with the following characters: . , _ , # or ~ in the source directory will not be included in the destination folder.

Rename the .css directory to css, fix the relative path, and it should work. :slightly_smiling_face: Alternatively (for 2.) you could disable Jekyll for your site, but I think renaming is less confusing.

Hello there airtower-luna,
Thank you for your reply I will try it out as HTML dev it is just more easy for me to use .css because if I look via FTP on my server or Directly on my File explorer it will pop up as the first result I will try it out and remove characters

Edit: So I tried it and it seems to work

1 Like