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

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

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

1 Like

.. 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.

1 Like

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

1 Like

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.

2 Likes

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

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

1 Like

<off-topic>

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

1 Like

This topic was automatically closed 91 days after the last reply. New replies are no longer allowed.