I am new to github. I've been following tutoials etc on how to set up pages. Now, i'm trying to move my codepen HTML and CSS over here. HTML is working, but CSS is not being applied.
I'm obviously doing something wrong. But I can't figure it out.
Thank you in advance fo any pointers.
Looking at your page, it appears the issue is the "/" at the beginning of your stylesheet's source. Change "/css/main.css" to "css/main.css" (on line 5 of index.html) and it should fix the issue you're having.
For future reference, if the html file is in the same directory as another folder or file, you don't need to include a slash at the beginning of the src or href attributes. Also, if you need to access files up one, two, or however many directories, you can use two periods as a substitute. (example below)
say our folders are..
root --> resources --> stylesheet.css
root --> lessons --> lesson-1 --> exercise-1 --> index.html
For our html file to access the stylesheet we could provide the following.
<link rel="stylesheet" href="../../../resources/stylesheet.min.css">
Basically two ".." moves up a directory and since index.html was three directories down, we moved up three times until we were in the root thus able to access the resources folder. You can also reference the current directory with "./".
If any questions, let us know.
CSS appears to be working when I look at https://noethix.github.io/trial. Do you see it as working now? Or can you describe what is not working for you?
Thank you, that helped me so much; not only for CSS but also for IMAGE directories (I used to work with underline before its names, like: "_css or _image").
So, I had to took them off and changed on HTML and CSS as well so it could work.