0

There is my problem: Since I had some organization issues with my website, I wanted to arrange my files to a better classification.

Now, the folder tree looks like:

  • www
    • ressources
      • images
        • ...
      • css
        • design.css
    • mypage1
      • index.html
    • mypage2
      • index.html
    • index.html

And now I don't know how to link the css file to the pages stored in a folder like the "mypage1" folder. To start from my C: drive will will produce path errors once online, I tried the "shortcuts to the css file in each folder" solution too, but I think there is a far better way to proceed. Need some help!

Thanks again!

1

2 Answers 2

1

use the link:

<link type="text/css" rel="stylesheet" href="../ressources/css/design.css">

here, used ../ going back folder..

Sign up to request clarification or add additional context in comments.

Comments

0

You can use:

<link rel="stylesheet" href="../ressources/css/design.css" type="text/css" media="all">

The .. will go one directory top. Since the html files are in a directory (like mypage1), this will go to the parent directory, which is www. Then the next that should be done is to pass the directory path to your CSS file, which in your case is /ressources/css/design.css.

1 Comment

Finally, I used the relative path to the files everywhere ("/ressources/css/design.css"). The ".." had sometime a strange comportment, like send me in inexistent directories... thanks for your help!

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.