How do I call the css folder on a sortof complex folder structure?


#1

How can I get the css working on the index.html files that are in sub-folders?

I already tried …/css/main.css, but it does not work

Or is there a better practice?

Thank you for your time


#2

Two preceeding dots takes you to the preceeding folder. Try two instead of three leading dots and see if that helps.


#3

.. means ‘go up one level’. (Disqus translates two dots into 3 automatically because… reasons?)

If you’re in /chapter/0/, and go up 1 level, and then go to css/, you end up at /chapter/css. But your CSS folder isnt there.


#4

Thanks, I didn’t know that. upsidedown

chapter/0/index.html
css/main,css

from the index page: The relative path would be
../../css/main.css

It might be easier to use absolute paths (aka: root relative) from index.html
/css/main.css


#5

Alternatively: putting / at the front of the url will take you to the root level automatically. So /css is a perfectly valid means to get to your css directory regardless of depth of file.


#6

…/…/css/main.css hit the spot

Man I have soo much to learn, Thank you soo much


#7

<off-topic>

Looks like “two adjacent periods? you meant ellipsis. OK, FIFY.”
</off-topic>