It is my first site with CSS, and I am facing my first CSS problem ever! Here is what I've done so far: * I uploaded my CSS folder into the root directory. * I uploaded my index pages and other pages into the root directory. Below is the link for the CSS: <link rel="stylesheet" href="css/style.css" type="text/css"> ==> Result: everything is fine. Here is the problem: I created a new directory, and then uploaded a page to this directory. Here is the problem: That page in the new directory (http://www.mysite/newdir/page.html) doesn't take the CSS specificities. My question: Should I upload the CSS file in each directory? I think I have to add this line: ../css/style.css So that <link rel="stylesheet" href="css/style.css" type="text/css"> will become: <link rel="stylesheet" href="../css/style.css" type="text/css"> Who can help me?
It would have been the polite thing to explain how you resolved the issue, as there are likely others with the same question. cheers, gary
A possible solution would be creating a symbolic link for newdir/css pointing to css. This way: cd newdir ln -s ../css . Code (markup): That way you can use the same "href" for your stylesheet on all your pages .
If you place a / (slash) symbol first, the path will be counted from the website root directory. So the solution is <link rel="stylesheet" href="/css/style.css" type="text/css"> HTML: