CSS file linking issue

47 Views Asked by At

Why is my CSS file not linked when the HTML file is inside a folder within the folder that contains both folders? I tried deleting the main folder address from the link and it still persists.

https://i.stack.imgur.com/Q1mWA.jpg

*The CSS file is OK and works only when the HTML file is not in a separate folder.

1

There are 1 best solutions below

0
On BEST ANSWER

If you want to use the relative path to the CSS file, then the link href needs to be relative to your html file:

<link rel="stylesheet" href="../css/9a.css">

The .. indicates that you want to navigate outside the "html" folder where your html file is located, then find the "css" folder, then find your css file.