Home > database >  How do I link to a CSS file that is in another folder, from within a subfolder?
How do I link to a CSS file that is in another folder, from within a subfolder?

Time:09-14

I am working on programming a very basic show streaming site for a project, and I have multiple folders. Folders include:

  • HTML
  • CSS
  • Shows

Inside of the "Shows" folder, I have a subfolder called "Testshow".

How do I link a CSS file from the CSS folder into an html file in the Testshow folder? I have tried

<link rel="stylesheet" href="/css/style.css">

and some other things, but nothing has been working.

CodePudding user response:

try something like this from your html file ../css/style.css

../ it means one folder up
../../ it means two folder up

CodePudding user response:

Thank you @Konstantin Savusia !

I used ../ before asking and it didn't work, but what you recommended did work!

I just added ../../ to the beggining.

  • Related