Skip to content Skip to sidebar Skip to footer

How Do I Link A Css Stylesheet From Another Folder Below In The Directory?

This is what I'm trying to link into my HTML and it's not working I tried taking off the two periods and that doesn't work either. Copy

More cases:

You can go up directories with ../

So for each ../ you will go up 1 directory


If you are in /public/files/ you can do

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

to get into /public/CSS/


If you need to acces the root it could be:

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

to get into /


You can also link it from the current script directory:

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

If you are in /public/files/ it would be /public/files/CSS/


And last from root to the directory:

<link rel="stylesheet" style="text/css" href="/public/CSS/file.css">

It would be /public/CSS/ and your file

Solution 2:

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

Solution 3:

if you want to import css files to another css file use below syntax:

@import"url or path to file";

Solution 4:

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

Or use full url :

<link rel="stylesheet" style="text/css" href="://www.yoursite.com/file.css">

In full url, :// is instead specify http:// or https://

Post a Comment for "How Do I Link A Css Stylesheet From Another Folder Below In The Directory?"